Runs the library's tests in on-going watch mode during active development.
When building a library, the best way to validate that it is working is by type-checking and running tests. Having the type-checking and tests running in watch mode make it easier to continuously ensure that new code is correct and refactors are non-breaking.
Looking for Node API docs? View companion start()
documentation.
To continuously run all modes on all files (default behavior):
benmvp start
To continuously run just type-checking on all files:
benmvp start --modes type
To continuously run linting & unit tests on all files:
benmvp start --modes lint spec
To continuously run all modes only on files within utils/
directories:
benmvp start --pattern utils/
To continuously run just linting on files within api/
directories:
benmvp start --modes lint --pattern api/
A space-separated list of the types or modes of tests to run. Aliased as -m
. Available modes:
lint
- Runs ESLint (files ending in.ts
or.tsx
)type
- Runs Typescript type-checking (files ending in.ts
or.tsx
)spec
- Runs Jest-based unit tests (files ending in.spec.ts
)
Optional. Defaults to all modes.
NOTE: Jest Watch Plugins are added to make watch mode even more useful. Specifically the eslint
watch-fix
plugin is added to enable auto-fixing of lint errors. However, for this to work,lint
has to be the first mode when specified.
A regexp pattern string that is matched against all tests paths before executing the test. Aliased as -p
.
Optional. Defaults to ''
(signifying no filter)
Looking for Node API docs? View companion start()
documentation.
Still unsure of how to use @benmvp/cli
? Ask for help!