-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.ts
38 lines (36 loc) · 1.1 KB
/
jest.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { getJestProjects } from "@nx/jest";
import type { Config } from "@jest/types";
export default {
projects: getJestProjects(),
};
export const getJestConfig = (): Config.InitialOptions => ({
cache: false,
verbose: true,
testEnvironment: "jsdom",
preset: "ts-jest/presets/default-esm",
testRegex: [".spec.ts", ".spec.tsx"],
testPathIgnorePatterns: ["__snapshots__"],
roots: ["<rootDir>"],
coverageProvider: "v8",
coverageReporters: [["lcov", { projectRoot: "../.." }], "clover", "json", "text"],
collectCoverageFrom: ["./src/**/*.ts", "./src/**/*.tsx"],
coveragePathIgnorePatterns: [
".spec",
"__tests__",
"test",
"tests",
"types",
"constants",
"index.ts",
"__snapshots__",
],
moduleDirectories: ["node_modules", "src"],
transform: {
"^.+\\.(j|t)sx?$": [
"ts-jest",
{ tsconfig: "./tsconfig.json", useESM: true, isolatedModules: true, babelConfig: "../../.babelrc.js" },
],
},
watchPlugins: ["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts", "jest-extended/all"],
});