Using Sinon calledWith to assert that a function was called correctly

added by JavaScript Kicks
11/17/2019 12:55:59 PM

316 Views

This is a unit test example to confirm that a particular function is called with the right parameters. In the code above, we have two functions calculateTotal and updateTotal. To test that they work correctly for a given input, we're going to test that the databaseUpdater function is called with the correct parameters.


0 comments