1
0
mirror of synced 2026-02-07 12:00:13 -05:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Brandon Bayer
c1e997ea52 Merge branch 'canary' into fix-jest 2021-03-02 20:43:13 -05:00
Brandon Bayer
3a42f94d6d change 2021-03-02 20:42:55 -05:00
Brandon Bayer
e5df3d0484 parse js test with babel 2021-03-02 19:06:02 -05:00
Brandon Bayer
539b1e3b19 fix the jest preset not typechecking test files (patch) 2021-03-02 19:00:06 -05:00
2 changed files with 14 additions and 6 deletions

View File

@@ -31,7 +31,6 @@ module.exports = {
globals: {
"ts-jest": {
tsconfig: __dirname + "/tsconfig.test.json",
isolatedModules: true,
},
},
}

View File

@@ -7,7 +7,20 @@ const {compilerOptions} = require(path.join(projectRoot, "tsconfig"))
const common = {
globalSetup: path.resolve(__dirname, "./jest-preset/global-setup.js"),
// Add type checking to TypeScript test files
preset: "ts-jest",
transform: {
"^.+\\.tsx?$": "ts-jest",
"^.+\\.jsx?$": "babel-jest",
},
globals: {
"ts-jest": {
tsconfig: {
jsx: "react",
},
// babelConfig: {
// // plugins: ["@babel/plugin-transform-react-jsx"],
// },
},
},
// Automatically clear mock calls and instances between every test
clearMocks: true,
testPathIgnorePatterns: [
@@ -18,10 +31,6 @@ const common = {
"<rootDir>/test/e2e",
"<rootDir>/cypress",
],
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(ts|tsx)$"],
transform: {
"^.+\\.(ts|tsx)$": "babel-jest",
},
// This makes absolute imports work
moduleDirectories: ["node_modules", "<rootDir>"],
// Ignore the build directories