2025-03-14 21:59:59 -06:00
|
|
|
# jest
|
|
|
|
|
|
|
|
|
|
> A zero-configuration JavaScript testing platform.
|
|
|
|
|
> More information: <https://jestjs.io>.
|
|
|
|
|
|
|
|
|
|
- Run all available tests:
|
|
|
|
|
|
|
|
|
|
`jest`
|
|
|
|
|
|
|
|
|
|
- Run the test suites from the given files:
|
|
|
|
|
|
|
|
|
|
`jest {{path/to/file1 path/to/file2 ...}}`
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
- Run the test suites from files within the current and subdirectories, whose paths match the given `regex`:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`jest {{regex1}} {{regex2}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
- Run the tests whose names match the given `regex`:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
`jest --testNamePattern {{regex}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Run test suites related to a given source file:
|
|
|
|
|
|
|
|
|
|
`jest --findRelatedTests {{path/to/source_file.js}}`
|
|
|
|
|
|
|
|
|
|
- Run test suites related to all uncommitted files:
|
|
|
|
|
|
|
|
|
|
`jest --onlyChanged`
|
|
|
|
|
|
|
|
|
|
- Watch files for changes and automatically re-run related tests:
|
|
|
|
|
|
|
|
|
|
`jest --watch`
|
|
|
|
|
|
|
|
|
|
- Display help:
|
|
|
|
|
|
|
|
|
|
`jest --help`
|