Mocha is a testing framework.
We use it to perform within our application
To make sure everything works correctly
First install Mocha npm install mocha --save
Keep the test script demo_test.js
to a folder /test
.
demo_test.js
const mocha = require('mocha');
const assert = require('assert');
describe('Some demo tests', function(){
//Create tests
it('adds two numbers together', function(){
assert(2+3===5)
})
})
Set the test
property to mocha
in package.json
and run npm run test
Top comments (0)