-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From jestjs/jest#12689, jest passes `rootDir` option to babel-jest. If rootDir is project sub-directory (e.g. `src/`, `__tests__/`), babel cannot load babel.config.js in project root.
- Loading branch information
Showing
17 changed files
with
333 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = { | ||
rootDir: "__tests__", | ||
testPathIgnorePatterns: ["lib/"], | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
roots: ["<rootDir>/__tests__"], | ||
testPathIgnorePatterns: ["<rootDir>/node_modules/", "lib/"], | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
testRegex: "/test/.*\\.ts$", | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
testRegex: "<rootDir>/test/.*\\.ts$", | ||
testEnvironment: "node", | ||
testPathIgnorePatterns: ["node_modules"], | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
presets: [ | ||
["@babel/preset-env", { targets: { node: "current" } }], | ||
"@babel/preset-typescript" | ||
] | ||
"@babel/preset-typescript", | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
module.exports = { | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
roots: ["<rootDir>/src"], | ||
testRegex: "/__tests__/.*\\.test\\.ts$", | ||
testEnvironment: "node", | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module.exports = { | ||
rootDir: "src", | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
roots: ["<rootDir>/src"], | ||
clearMocks: true, | ||
testPathIgnorePatterns: ["fixtures"], | ||
testPathIgnorePatterns: ["<rootDir>/node_modules/", "fixtures"], | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
"@babel/preset-env", | ||
{ targets: { node: "current" } }, | ||
], | ||
"@babel/preset-typescript", | ||
], | ||
presets: [ | ||
["@babel/preset-env", { targets: { node: "current" } }], | ||
"@babel/preset-typescript", | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = { | ||
rootDir: "src", | ||
testEnvironment: "node", | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
roots: ["<rootDir>/src"], | ||
testEnvironment: "node", | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
module.exports = { | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
roots: ["<rootDir>/src"], | ||
clearMocks: true, | ||
rootDir: "src", | ||
testPathIgnorePatterns: ["node_modules"], | ||
testEnvironment: "node", | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = { | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
testRegex: "(?<!site)/test/[^\\/]*\\.spec.ts$", | ||
testEnvironment: "node", | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = { | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
testRegex: "/test/.*-test\\.js$", | ||
testEnvironment: "jsdom", | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = { | ||
rootDir: "src", | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
roots: ["<rootDir>/src"], | ||
testEnvironment: "node", | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
module.exports = { | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
clearMocks: true, | ||
rootDir: "src", | ||
setupFilesAfterEnv: ["<rootDir>/__tests__/setup.ts"], | ||
testPathIgnorePatterns: ["node_modules", "<rootDir>/__tests__/setup.ts"], | ||
roots: ["<rootDir>/src"], | ||
setupFilesAfterEnv: ["<rootDir>/src/__tests__/setup.ts"], | ||
testPathIgnorePatterns: [ | ||
"<rootDir>/node_modules/", | ||
"<rootDir>/src/__tests__/setup.ts", | ||
], | ||
testEnvironment: "node", | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
module.exports = { | ||
rootDir: "src", | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
roots: ["<rootDir>/src"], | ||
testEnvironment: "node", | ||
testPathIgnorePatterns: ["node_modules", "<rootDir>/__tests__/sample"], | ||
testPathIgnorePatterns: [ | ||
"<rootDir>/node_modules/", | ||
"<rootDir>/src/__tests__/sample", | ||
], | ||
testTimeout: 30000, | ||
}; | ||
module.exports = config; |
Oops, something went wrong.