test-runner-cli
v0.1.0 test bin cli
test-runner-cli
A simple way to run tests
Features
- Simple no API to learn, zero-config
- Natively supports ESM
Install
npm install test-runner-cli
Usage
test-runner [dir|file] # default is dir `.`
Create a test file endsWith .test.js
or naming test.js
and use Node's built-in assert module, then export the test function.
import {strict as assert} from 'assert' // Node <=16
// import { equal } from 'assert/strict' // Node >=16
export function testSomeThing() {
assert.equal(1 + 2, 3)
}
Edit package.json:
{
"scripts": {
"test": "test-runner"
}
}
Run test files:
npm test // run all test files `.`
npx test-runner-cli fixtures test.js // run specify directory or file
License
MIT
npm i test-runner-cli
Metadata
- MIT
- ^14.13.1 || >=16.0.0
- yuler
- released 8/17/2021