-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for jest 26, log warnings with legacy configs
- Loading branch information
1 parent
8f70a2a
commit 46ef443
Showing
14 changed files
with
86 additions
and
32 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 |
---|---|---|
|
@@ -10,7 +10,8 @@ | |
npm-debug.log | ||
|
||
# Build | ||
dist | ||
/transform | ||
/preset | ||
|
||
# Coverage | ||
coverage | ||
|
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 |
---|---|---|
|
@@ -5,5 +5,6 @@ package-lock.json | |
CHANGELOG.md | ||
node_modules | ||
coverage | ||
dist | ||
/preset | ||
/transform | ||
*.actual.* |
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
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import sharedPreset from "../shared-preset"; | ||
|
||
export = { | ||
...sharedPreset, | ||
// uses a webpack style resolver, the default one has many issues. | ||
resolver: require.resolve("./resolver"), | ||
// preprocesses Marko files. | ||
transform: { | ||
"\\.marko$": require.resolve("../../transform/browser"), | ||
...sharedPreset.transform | ||
} | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { create, getDefaultConfig } from "enhanced-resolve-jest"; | ||
|
||
export = create(jestConfig => { | ||
const baseConfig = getDefaultConfig(jestConfig); | ||
baseConfig.aliasFields = ["browser"]; | ||
baseConfig.mainFields = ["browser", "main"]; | ||
return baseConfig; | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import sharedPreset from "../shared-preset"; | ||
|
||
export = { | ||
...sharedPreset, | ||
// avoid loading jsdom. | ||
testEnvironment: "node", | ||
// preprocesses Marko files. | ||
transform: { | ||
"\\.marko$": require.resolve("../../transform/node"), | ||
...sharedPreset.transform | ||
} | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defaults } from "jest-config"; | ||
|
||
export = { | ||
// allows for stuff like file watching of `.marko` files | ||
moduleFileExtensions: defaults.moduleFileExtensions.concat("marko"), | ||
transform: { "\\.[tj]s$": "babel-jest" }, | ||
// Jest ignores node_module transforms by default. | ||
// Here we whitelist all `.marko` files. | ||
transformIgnorePatterns: ["node_modules/.*(?<!\\.marko)$"] | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import createTransform from "./create-transform"; | ||
export = createTransform({ browser: true }); |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import createTransform from "./create-transform"; | ||
export = createTransform({ browser: false }); |
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