HOME

TheInfoList



OR:

Mocha is a JavaScript test framework for Node.js programs, featuring browser support, asynchronous testing, test coverage reports, and use of any assertion library.


Assertion Libraries

Mocha can be used with most JavaScript assertion libraries, including: * should.js * express.js * chai * better-assert * unexpected


Usage and examples

$ npm install -g mocha $ mkdir test $ $EDITOR test/test.js # or open with your favorite editor var assert = require("assert") describe('Foo', function()) $ mocha . 1 test complete (1ms)
For asynchronous testing, invoke the callback, and Mocha will wait for completion. describe('Foo', function())


See also

*
Jasmine Jasmine ( taxonomic name: ''Jasminum''; , ) is a genus of shrubs and vines in the olive family (Oleaceae). It contains around 200 species native to tropical and warm temperate regions of Eurasia, Africa, and Oceania. Jasmines are widely cultiva ...
* List of unit testing frameworks * npm * QUnit *
Unit.js Unit.js is an open source unit testing framework for the JavaScript programming language, running on Node.js and the browser. Usage A simple hello world test looks like the code below. var example = 'Hello world!'; test.string(example ...
*
Jest A joke is a display of humour in which words are used within a specific and well-defined narrative structure to make people laugh and is usually not meant to be interpreted literally. It usually takes the form of a story, often with dialogue, ...
* JavaScript framework * JavaScript library


References


External links

* {{JavaScript JavaScript libraries JavaScript programming tools Software using the MIT license 2011 software