https://github.com/yuler/test-runner-cli
A simple way to run tests
https://github.com/yuler/test-runner-cli
Last synced: about 1 year ago
JSON representation
A simple way to run tests
- Host: GitHub
- URL: https://github.com/yuler/test-runner-cli
- Owner: yuler
- Created: 2021-08-17T04:19:52.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-17T15:19:08.000Z (almost 5 years ago)
- Last Synced: 2025-04-06T12:13:19.880Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# test-runner-cli [](https://github.com/yuler/test-runner-cli/actions/workflows/ci.yml)
> A simple way to run tests
## Features
- Simple no API to learn, zero-config
- Natively supports ESM
## Install
```bash
npm install test-runner-cli
```
## Usage
```bash
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](https://nodejs.org/api/assert.html) module, then export the test function.
```js
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:
```json
{
"scripts": {
"test": "test-runner"
}
}
```
Run test files:
```bash
npm test // run all test files `.`
npx test-runner-cli fixtures test.js // run specify directory or file
```
## License
MIT