@comandeer/mocha-lib-tester
Super opinionated test library using Mocha, Babel, Chai, Sinon, sinon-chai, proxyquire and IstanbulJS.
How does it work?
Installation
npm install @comandeer/mocha-lib-tester --save-dev
Usage
Just make it a npm script:
"scripts": {
"test": "mlt"
}
Run only selected steps
You can also run only selected steps, e.g.
mlt test coverage
The above command will run only Mocha tests and display code coverage info.
Available steps
Id | Name | Description |
---|---|---|
lint | Linter | Runs ESLint against the code. |
test | Tester | Runs tests against the code. |
coverage | Code Coverage | Gathers and displays info about code coverage. |
codecov | CodeCov | Uploads info about code coverage to CodeCov. |
Watch mode
The command also allows to run tests in a watch mode, which reruns tests every time any file changes in your project's src/
and tests/
directories. To use the watch mode just add --watch
argument:
mlt --watch
You can also watch only selected steps, e.g.
mlt test --watch
Configuration
No configuration. Consider it a feature.
Enabling Intellisense
For now to enable Intellisense for tests, you need to add jsconfig.json
file to your project:
{
"compilerOptions": {
"typeRoots": [
"./node_modules/@types",
"./node_modules/@comandeer"
]
}
}
License
See LICENSE file for details.