Mocha is a unittest framework for Node. In this document, we explain how you can test your javascript code and also your HTTP servers.
Use npm
to install Mocha:
npm install mocha
Mocha is a unittest framework for Node. In this document, we explain how you can test your javascript code and also your HTTP servers.
Use npm
to install Mocha:
npm install mocha
'use strict'; | |
describe('mocha before hooks', function () { | |
before(() => console.log('*** top-level before()')); | |
beforeEach(() => console.log('*** top-level beforeEach()')); | |
describe('nesting', function () { | |
before(() => console.log('*** nested before()')); | |
beforeEach(() => console.log('*** nested beforeEach()')); | |
it('is a nested spec', () => true); | |
}); |