https://github.com/sodiray/inforce
A simple function based test runner
https://github.com/sodiray/inforce
cli javascript nodejs test-runner testing
Last synced: 6 months ago
JSON representation
A simple function based test runner
- Host: GitHub
- URL: https://github.com/sodiray/inforce
- Owner: sodiray
- Created: 2020-06-02T05:36:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T20:03:28.000Z (over 3 years ago)
- Last Synced: 2025-03-21T04:37:29.926Z (7 months ago)
- Topics: cli, javascript, nodejs, test-runner, testing
- Language: JavaScript
- Size: 154 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# :cop: Inforce
A simple function based test runner. Its not BDD. Does not include an assertion library - only a test collector and test runner.## :package: Install
`npm install --dev inforce`
or
`yarn add --dev inforce`## :wrench: Usage
Add as an npm script in `package.json`.
```
"scripts": {
"test": "inforce",
"test-example": "inforce --targetPath ./example.test.js",
"test-verbose": inforce --level verbose
}
```### :abacus: Options
Check out the main function's params/defaults [here](https://github.com/rayepps/inforce/blob/6d400c01f1cddcf122b069ba6e0b29c1fa337af5/index.js#L10).#### --targetPath
The relative path to search for tests. Can be directory or file. Deafults to `./src`.#### --testFileRegex
The pattern to use when filtering test files. Defaults to `.*\.test\.js`.#### -- testFnRegex
The pattern to use when filtering exported functions from test modules. Defaults to `^test.*`. If you want to execute all functions exported from a test module -- so you don't have to name test functions with `test` -- set this to something like `.+`.#### --level
The log level to use.
- slient: log nothing
- default: log enough for normal dev use (default)
- verbose: log lots. helpful for debugging test collection/running not working as you expect
- debug: log everything. helpful for debugging issues with the inforce project## Example Output
## Example Test File
See [example.test.js](https://github.com/rayepps/inforce/blob/master/example.test.js)