How do I write Jest tests that only runs when specifically invoked on the command line?
I want to have integration-like tests that interact with online services from Google and Amazon in a React project.
If I create a differently named test file src/google.itest.js:
jest --testPathPattern="\.itest"
Jest still does not run the tests, probably because it is blocked by the testMatch configuration option:
testMatch:
**/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x)
How do I write Jest tests that only runs when specifically invoked on the command line?
It works with RegExp (presumably those are ECMAScript regexps):
jest --testRegex 'src/.*itest.*'
Note that an equal sign separating the long option and its value is not required
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With