-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.mjs
43 lines (41 loc) · 1.12 KB
/
jest.config.mjs
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
43
import { env, platform } from "node:process";
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config = {
displayName: "@photostructure/fs-metadata",
testEnvironment: "jest-environment-node",
roots: ["<rootDir>/src"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
// setupFiles: ["<rootDir>/.jest-setup.mjs"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: "tsconfig.json",
},
],
},
extensionsToTreatAsEsm: [".ts"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
collectCoverage: !env.TEST_MEMORY,
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov"],
coveragePathIgnorePatterns: ["/__tests__/", "/test-utils/"],
coverageThreshold: {
// These are low because we're doing integration tests and there are quite
// different codepaths for macOS, Windows, and Linux
global: {
branches: 70,
functions: 80,
lines: 75,
statements: 75,
},
},
verbose: true,
silent: false,
randomize: true,
setupFilesAfterEnv: ["jest-extended/all"],
};
export default config;