Skip to content

Commit afa2e20

Browse files
committed
undelete jest.config.js
1 parent 69d7cfb commit afa2e20

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

jest.config.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const aliases = require("./build/aliases");
2+
3+
const moduleNameMapper = Object.keys(aliases).reduce((acc, alias) => {
4+
acc[`^${alias}/(.*)$`] = `<rootDir>${aliases[alias].slice(1)}/$1`;
5+
return acc;
6+
}, {});
7+
8+
moduleNameMapper["common/(.*)$"] = "<rootDir>/src/common/$1";
9+
10+
module.exports = {
11+
testRegex: "(/__tests__/.*|\\.spec|\\.test)\\.(ts|js)$",
12+
// All imported modules in your tests should be mocked automatically
13+
automock: false,
14+
15+
clearMocks: true,
16+
resetMocks: true,
17+
resetModules: true,
18+
restoreMocks: true,
19+
20+
collectCoverage: true,
21+
// collectCoverageFrom: ["src/**/*.{ts,tsx,js,jsx}"],
22+
coverageDirectory: "dist/coverage",
23+
coverageReporters: ["html"],
24+
coveragePathIgnorePatterns: ["/node_modules/", "/dist/", "/bundled"],
25+
26+
// The paths to modules that run some code to configure or set up the testing environment before each test
27+
setupFiles: ["dotenv/config"],
28+
29+
setupFilesAfterEnv: ["jest-extended/all"],
30+
31+
// The test environment that will be used for testing
32+
testEnvironment: "jsdom",
33+
34+
preset: "ts-jest",
35+
36+
testPathIgnorePatterns: ["/dist/", "/node_modules/", "/bundled/"],
37+
38+
moduleNameMapper,
39+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

tsconfig.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,9 @@
5757
"@macros": ["renderer/macros/index.ts"]
5858
},
5959
"typeRoots": ["./src/common/types/declarations", "./node_modules/@types"],
60+
6061
"outDir": "generated",
61-
"resolveJsonModule": true,
62-
"types": [
63-
"vite/client",
64-
"node",
65-
"jest",
66-
"offscreencanvas",
67-
"npmcli__package-json"
68-
]
62+
"resolveJsonModule": true
6963
},
7064
"include": ["src/**/*"],
7165
"exclude": [

0 commit comments

Comments
 (0)