command
npm test -t="needsCheckInOrOut"
should filter out describe blocks having title doesn't start with needsCheckInOrOut, ie. runs single describe block like below.

Runs all describe blocks under the file.

I have a single test file named index.test.ts and it has some describe blocks that takes longer time to execute. So I want to run certain describe blocks by specifying their title via -t option.
Is that possible through -t option? Or if it's not, is there any alternative for specifying certain describe block under the test file via CLI?
For example, I have those test cases.
β input: Jan 13β18, 2019 (4ms)
β input: Jan 13β15, 2019 (11ms)
β input: Jan 15β17, 2019 (1ms)
β input: Jan 15βFeb 1, 2019
β input: Dec 31βJan 15, 2019
detect language
β should detect `μλ
νμΈμ!μμ λ¬Έμλλ¦¬κ³ μΆμ΄μμοΏ½νΉμ μ§μμ λ°λ€κ° 보μ΄λμ?` to `ko` (730ms)
β should detect `hello, we are coming from germany and looking forward to staying at your place :)` to `en` (391ms)
β should detect `Qu'est-ce que vous faites?` to `en` (368ms)
β should detect `.` to `ko` (353ms)
β should detect `` to `ko` (593ms)
send gmail message
β can send mail subject and body containing non ascii characters (1775ms)
send message
β case check-in (17277ms)
β case check-out (13311ms)
β case reservation-confirmed (15373ms)
And if I want to test only detect language describe block, then I can to use
npm test -t="detect language"
As a result, only one describe block that has matching title would be tested.
detect language
β should detect `μλ
νμΈμ!μμ λ¬Έμλλ¦¬κ³ μΆμ΄μμοΏ½νΉμ μ§μμ λ°λ€κ° 보μ΄λμ?` to `ko` (730ms)
β should detect `hello, we are coming from germany and looking forward to staying at your place :)` to `en` (391ms)
β should detect `Qu'est-ce que vous faites?` to `en` (368ms)
β should detect `.` to `ko` (353ms)
β should detect `` to `ko` (593ms)
npx envinfo --preset jest System:
OS: macOS 10.14.3
CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
Binaries:
Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node
npm: 6.8.0 - ~/.nvm/versions/node/v10.15.1/bin/npm
npmPackages:
jest: ^23.6.0 => 23.6.0
Try running the command like this:
npm test -- -t="needsCheckInOrOut"
As it is stated on the documentation:
Using with npm scripts
If you run Jest via npm test, you can still use the command line arguments by inserting a -- between npm test and the Jest arguments.
Closing this issue as Luanf's answer works.
Most helpful comment
Try running the command like this:
npm test -- -t="needsCheckInOrOut"As it is stated on the documentation: