`jest <regexForTestFiles>` CLI not picking up tests
See original GitHub issuejest <regexForTestFiles>
CLI not picking up tests.
Perhaps related to https://github.com/facebook/jest/pull/5582
What is the current behavior?
Barebones demo repo: https://gitlab.com/MadLittleMods/jest-test-regex-issue-barebones-test-case1
Reproduction steps
- Install
jest@22.4.2
- Save a file with some tests in
some-test.js
jest some-test.js
- Notice,
No tests found
$ jest some-test.js
No tests found
In /jest-test-regex1
3 files checked.
testMatch: **/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x) - 0 matches
testPathIgnorePatterns: /node_modules/ - 3 matches
Pattern: some-test.js - 0 matches
What is the expected behavior?
The jest <regexForTestFiles>
CLI syntax should match files regardless of testMatch
config.
This previously worked with jest@22.3.0
but I am unable to downgrade successfully and confirm because it always installs jest-cli@22.4.2
. Any tips? Related https://github.com/facebook/jest/issues/405, https://github.com/facebook/jest/issues/3391
This installs jest@22.3.0
and jest-cli@22.3.0
but throws other errors
$ npm install jest@22.3.0 && cd ./node_modules/jest && rm -rf ./node_modules/jest-cli && npm install jest-cli@22.3.0 && cd ../../
$ npm test
TypeError: (0 , (_jestUtil || _load_jestUtil(...)).validateCLIOptions) is not a function
at buildArgv (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:133:58)
at Object.<anonymous> (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:41:20)
at Generator.next (<anonymous>)
at step (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:53:2732)
at /jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:53:2962
at new Promise (<anonymous>)
at Object.<anonymous> (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:53:2643)
at Object.run (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/build/cli/index.js:53:48)
at Object.<anonymous> (/jest-test-regex1/node_modules/jest/node_modules/jest-cli/bin/jest.js:16:27)
at Module._compile (module.js:643:30)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Jest CLI Options
It is possible to run test suites by providing a pattern. Only the files that the pattern matches will be picked up and...
Read more >Jest CLI Options - GitHub Pages
It is possible to run test suites by providing a pattern. Only the files that the pattern matches will be picked up and...
Read more >Dynamically matching files in Jest | by Romain Kelifa - Medium
Article of today is about dynamically matching files for your tests run with Jest. Use case. Let's say you have 2 different kinds...
Read more >Jest regex to match certain test files - Stack Overflow
js . Running Jest: jest ".*\\.integration\\.js". produces this error: No tests found, exiting ...
Read more >vue/cli-plugin-unit-jest
Any js(x)/ts(x) files inside __tests__ directories. Usage: vue-cli-service test:unit [options] <regexForTestFiles>. All Jest command line ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This comment explains it well,
I was caught in the between rollout and rollback where this worked and all of the sudden didn’t work in a minor release.
Thanks for the extra info 🙂
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.