Skip to content

Refac function argument recording. fixes #25, #23 - #30

Merged
ffMathy merged 2 commits into
ffMathy:masterfrom
domasx2:refac-function-argument-recording
Mar 24, 2019
Merged

Refac function argument recording. fixes #25, #23#30
ffMathy merged 2 commits into
ffMathy:masterfrom
domasx2:refac-function-argument-recording

Conversation

@domasx2

@domasx2 domasx2 commented Mar 23, 2019

Copy link
Copy Markdown
Contributor

Hi, as promised:

This PR fixes #25 (mine) and #23 (I couldn't leave a test failing :P)

The main change here is that now there's only one FunctionState per property, and it records arguments for every call. Call verification is done by checking if and how many calls match the arguments in received() check.

For bonus points, added support for methods with optional parameters :)

This PR also opens an easy path to implement call order verification & argument capturing

@domasx2 domasx2 mentioned this pull request Mar 23, 2019
@domasx2

domasx2 commented Mar 23, 2019

Copy link
Copy Markdown
Contributor Author

I'd omit build output from git repo, instead adding prepack script to build it before npm publish or if it's installed from git :)

@ffMathy

ffMathy commented Mar 24, 2019

Copy link
Copy Markdown
Owner

Very impressive!

@ffMathy
ffMathy merged commit 6a81bed into ffMathy:master Mar 24, 2019
Karql added a commit to Karql/FluffySpoon.JavaScript.Testing.Faking that referenced this pull request Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

call verification does not work when using Arg.all() to set up return values

2 participants