diff --git a/package.json b/package.json index 01f0a2781f..9b625ea397 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,9 @@ "devEngines": { "node": "8.x || 9.x" }, + "jest": { + "testRegex": "/scripts/jest/dont-run-jest-directly\\.js$" + }, "scripts": { "build": "npm run version-check && node ./scripts/rollup/build.js", "flow-coverage": "flow-coverage-report --config ./.flowcoverage", diff --git a/scripts/jest/dont-run-jest-directly.js b/scripts/jest/dont-run-jest-directly.js new file mode 100644 index 0000000000..672d07caec --- /dev/null +++ b/scripts/jest/dont-run-jest-directly.js @@ -0,0 +1,3 @@ +'use strict'; + +throw new Error("Don't run `jest` directly. Run `yarn test` instead.");