Skip to content

Commit f3af3ff

Browse files
committed
Jest: Fix jest-haste-map warning
Tell Jest to ignore package.json files in tests/build/ and in the cypress/ folder. Otherwise, it prints out a warning about duplicate names used in package.json. Example: jest-haste-map: Haste module naming collision: next-on-netlify-test The following files share their name; please adjust your hasteImpl: * <rootDir>/fixtures/package.json * <rootDir>/builds/customNextDistDir.test/package.json
1 parent 09f06e1 commit f3af3ff

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"/lib"
2626
],
2727
"scripts": {
28-
"test": "jest",
28+
"test": "jest --config tests/jest.config.js",
2929
"cypress:local": "env CYPRESS_DEPLOY=local cypress run --config-file false",
3030
"cypress:netlify": "env CYPRESS_DEPLOY=netlify cypress run --config-file false"
3131
},

tests/jest.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2-
// Do not scan the ./builds/ folder for tests or package.json files
3-
testPathIgnorePatterns: ["./builds/"]
2+
// Do not scan the ./builds/ folder and the Cypress folder for tests or
3+
// package.json files
4+
modulePathIgnorePatterns: ["./builds/", "<rootDir>/cypress/"]
45
};

0 commit comments

Comments
 (0)