Sinon.js
Replace JavaScript callbacks with test doubles and inspect how code calls them.
sinonjs · Code and testing
GitHub projectOpen source Open on GitHubHow to try it
In a Node.js project, install [email protected]. Use a stub for a fictional inventory source and verify it receives one expected argument.
What we tested
22.1.0. Use a stub for a fictional inventory source and verify it receives one expected argument. Returned the controlled sample data and verified the named argument and call count.