Tutorial by Examples

You can install mocha either globally or in your project folder. The latter is the preferred way. In all the example let's assume that all the test files are in a test folder within the project folder. Install Mocha locally To install mocha in your project folder, you can use the following npm co...
var assert = require('assert'); describe('String', function() { describe('#split', function() { it('should return an array', function() { assert(Array.isArray('a,b,c'.split(','))) }); }); });

Page 1 of 1