HOME

TheInfoList



OR:

Mocha is a
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
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 (botanical name: ''Jasminum'', pronounced ) is a genus of shrubs and vines in the olive family of Oleaceae. It contains around 200 species native to tropical and warm temperate regions of Eurasia, Africa, and Oceania. Jasmines are wid ...
*
List of unit testing frameworks This is a list of notable test automation frameworks commonly used for unit testing. Such frameworks are not limited to unit-level testing; can be used for integration and system level testing. Frameworks are grouped below. For unit testing, a ...
* npm *
QUnit QUnit is a JavaScript framework for unit testing. Originally developed for testing jQuery, jQuery UI and jQuery Mobile, it is a generic framework for testing any JavaScript code. It supports client-side environments in web browsers, and server ...
*
JavaScript framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and ...
*
JavaScript library A JavaScript library is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. They can be included in a website by embedding it directl ...


References


External links

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