-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
function call assertions #560
Comments
In this case, you can't do it with tape as-is. You need an object mocking/spying library - which is what https://npmjs.com/sinon is for. You can then make assertions about your sinon spies/mocks/stubs using tape. |
The alternative answer is that writing a test which checks what happens to the internals of a module is fragile and not a very useful test. Your better of writing a test that checks the black box behavior of a module. Or changing the API of a module to make it easier to test. If you want to write an assertion that a module for example does a Changing the module would be something like |
Hi, So i've been using tape for quite some time now, both in my personal projects and companies, but I'm finding there's no way to write an assertion that checks if a function has been called as part of another function. or maybe I haven't just looked hard enough
example of what i'm trying to do
so is there any recommended way to do this, or maybe there's an internal function i'm missing on
Appreciate the help
The text was updated successfully, but these errors were encountered: