Skip to content

Testing ReactComponents

andrerpena edited this page Mar 14, 2015 · 6 revisions

ReactComponents use Mocha as the test framework.

To install Mocha:

$ npm install -g mocha

This will make the mocha CLI globally available.

Running Mocha tests

To test ReactComponents, go to the root directory and simply type mocha. Mocha will automatically search for a directory called test and run all tests inside it, recursively.

You can also run Mocha in watch mode, meaning that, it will automatically listen to file changes and re-run the tests as any file changes. In order to run in watch mode, type mocha --watch.

If you are using WebStorm, you can run Mocha from the console (alt + F12):

Clone this wiki locally