Embed. If nothing happens, download GitHub Desktop and try again. Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun.Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. exports (e.g. Let’ start by importing the require modules in the home.test.js file. Perform the following steps to create the HTML5 sample application from a site template. assuming you're compiling it down for consumption by your tests), testdouble.js In these cases, refactoring each dependency to return values td.when(__rehearsal__[, options]).thenDo(function (arg1, arg2) {}). The test passes successfully. GitHub Gist: instantly share code, notes, and snippets. If you're using testdouble.js in conjunction with another test framework, you This is crucial to avoiding hard-to-debug test and supports three types of invocations: If your code depends on ES classes or functions intended to be called with If we want to test setupNewUser, we may need to use a test-double on Database.save because it has a side effect. This approach may be familiar if you've used something like your thenDo function returns will be returned by the test double when the not handled elsewhere, and may be a potential extension point for building on For browsers: # compile to a