Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visibility/log on arguments mismatch in function call #210

Open
dorgalam opened this issue Apr 29, 2021 · 1 comment
Open

Visibility/log on arguments mismatch in function call #210

dorgalam opened this issue Apr 29, 2021 · 1 comment

Comments

@dorgalam
Copy link

Hi!
Been using ts-mockito quite a bit now, and really liking it.
My biggest issue though, is when you're mocking isn't the same as actual function calls, and I have no idea why.
It would be extremely helpful if each matcher was also able to let you know why it failed, and then log it.

If that sounds like something you want in this package, I wouldn't mind contributing it myself

My idea in a nutshell, is to add another method to Matcher class that returns string log on why something didn't pass, and if the .every() call returns false, then call each matcher's whatWentWrong function and finally output everything to some debug.info log.

@albertodiazdorado
Copy link

The library is unusable without this feature IMO

I am too tired of writing

expect(capture(method).last()[0]).toEqual(expectedArgs)

Everytime a test turns red. I understand that this is open source and probably none ever had time to write a proper implementation, but none who is sane would believe that the current design is desirable in any sense.

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

No branches or pull requests

2 participants