forked from flojoy-ai/studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
42 lines (41 loc) · 1.21 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
39
40
41
42
/** @type {import("ts-jest").JestConfigWithTsJest} */
import type { Config } from "@jest/types";
import { pathsToModuleNameMapper } from "ts-jest";
import { compilerOptions } from "./tsconfig.json";
const config = async (): Promise<Config.InitialOptions> => {
return {
preset: "ts-jest",
setupFilesAfterEnv: ["<rootDir>/src/setupTests.js"],
displayName: {
name: "flojoy unit-testing",
color: "greenBright",
},
verbose: true,
setupFiles: ["dotenv/config"],
testMatch: ["**/**/*.test.{ts,tsx,js}"],
testEnvironment: "jsdom",
detectOpenHandles: true,
collectCoverage: true,
forceExit: true,
clearMocks: true,
coverageThreshold: {
global: {
lines: 0, // TODO: increamentially increase coverage threshold
},
},
roots: ["<rootDir>"],
modulePaths: ["."],
moduleNameMapper: {
"\\.(css|less)$": "<rootDir>/src/__tests__/config/CSSStub.js",
...pathsToModuleNameMapper(compilerOptions.paths),
},
transform: {
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "./tsconfig.json" }],
},
testPathIgnorePatterns: [
"<rootDir>/node_modules/",
"<rootDir>/src/__tests__/__utils__",
],
};
};
export default config;