Simple (very) polyfill to emulate mocha tests in mjs enviroment. For use simply import
npm install mjs-mochashell
$ npm i -D mjs-mocha
`Usage
$3
`js
import 'mjs-mocha';describe('My test', () => {
...
})
`$3
Add the script to your package.json.`json
{
"scripts": {
"test": "mjs-mocha"
}
}
`Then just run
npm test.mjs-mocha will run all
.test.mjs and .spec.mjs files in your repository.Also you can specify test files to run by passing them as arguments.
#### Example
project structure:
- src
- ...
- tests
- first.test.mjs
- second.test.mjs
- third.test.mjs
`shell
mjs-mocha first second
``