2018-11-20 21:22:00 +00:00
|
|
|
# jest
|
|
|
|
|
|
|
|
> A zero-configuration JavaScript testing platform.
|
2019-06-05 08:55:41 +01:00
|
|
|
> More information: <https://jestjs.io>.
|
2018-11-20 21:22:00 +00:00
|
|
|
|
2019-11-05 01:41:20 +00:00
|
|
|
- Run all available tests:
|
2018-11-20 21:22:00 +00:00
|
|
|
|
|
|
|
`jest`
|
|
|
|
|
2021-05-10 10:03:12 +01:00
|
|
|
- Run the test suites from the given files:
|
2019-09-03 21:28:05 +01:00
|
|
|
|
2021-05-10 10:03:12 +01:00
|
|
|
`jest {{path/to/file1}} {{path/to/file2}}`
|
2019-09-03 21:28:05 +01:00
|
|
|
|
2021-05-10 10:03:12 +01:00
|
|
|
- Run the test suites from files within the current and subdirectories, whose paths match the given regular expression:
|
2018-11-20 21:22:00 +00:00
|
|
|
|
2021-05-10 10:03:12 +01:00
|
|
|
`jest {{regular_expression1}} {{regular_expression2}}`
|
|
|
|
|
|
|
|
- Run the tests whose names match the given regular expression:
|
|
|
|
|
|
|
|
`jest --testNamePattern {{regular_expression}}`
|
2018-11-20 21:22:00 +00:00
|
|
|
|
2019-11-05 01:41:20 +00: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:
|
2018-11-20 21:22:00 +00:00
|
|
|
|
2019-09-06 19:50:55 +01:00
|
|
|
`jest --onlyChanged`
|
2018-11-20 21:22:00 +00:00
|
|
|
|
2019-11-05 01:41:20 +00:00
|
|
|
- Watch files for changes and automatically re-run related tests:
|
2018-11-20 21:22:00 +00:00
|
|
|
|
|
|
|
`jest --watch`
|
|
|
|
|
2023-12-27 06:41:30 +00:00
|
|
|
- Display help:
|
2018-11-20 21:22:00 +00:00
|
|
|
|
|
|
|
`jest --help`
|