0.7.0 • Published 1 year ago

@comandeer/mocha-lib-tester v0.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@comandeer/mocha-lib-tester

Build Status Dependency Status devDependencies Status codecov npm (scoped)

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

IdNameDescription
lintLinterRuns ESLint against the code.
testTesterRuns tests against the code.
coverageCode CoverageGathers and displays info about code coverage.
codecovCodeCovUploads 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.