I\'m trying to learn the A Test Driven Approach with MongodB. The folder structure
A user.js
to test in the src folder
const mongo
There is a very easy way to load tests sequentially.
Step 1 : Set up a test script in package.json: e.g.
"scripts": {
"test": "mocha ./tests.js"
}
Let us assume that tests.js is a file which defines the order to execute tests.
require("./test/general/test_login.js");
require("./test/Company/addCompany.js");
...
...
So here test_login will run first and then others one by one.
Step 2: Then run tests with:
$ npm test