Skip to content

Conversation

@notanengineercom
Copy link
Collaborator

Closes #59
The issue with the received optional parameter fixed itself with just swapping the order of the override types for TerminatingObject.


This pr replaces some of the hardcoded values around the library with typed ones. It also enhances a lot the logging output of the Substitute proxies, so hopefully no more TypeError: Cannot convert object to primitive value.
Some releases back, when doing a console.log of a non mocked property you would get the TypeError described before. Now it's something like [Function: SubstituteJS] -> add, where add is the last accessed property / method of the proxy before the logging.

@notanengineercom notanengineercom added the enhancement New feature or request label Feb 23, 2020
@notanengineercom notanengineercom changed the title Better debuggability Fix received optional parameter issue and better debuggability Feb 23, 2020
Copy link
Owner

@ffMathy ffMathy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very impressive! One very minor comment needs fixing and I'll merge!

@notanengineercom
Copy link
Collaborator Author

Thanks, I had some time over the weekend to work on this 😄
And well spotted! 👍

@ffMathy ffMathy merged commit df69e8e into master Feb 24, 2020
@ffMathy
Copy link
Owner

ffMathy commented Feb 24, 2020

You're quite amazing and pretty productive. You've managed to almost elliminate all open issues! It's insane. Nicely done.

@notanengineercom
Copy link
Collaborator Author

Thanks man! I'm glad I've been able to do my bit. I quite like the library, it's really nice to work with. So thanks to you for creating it 😄

@notanengineercom notanengineercom deleted the better-debuggability branch February 24, 2020 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot mock function with optional parameters

3 participants