-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
54 lines (54 loc) · 1.35 KB
/
Copy pathjest.config.js
File metadata and controls
54 lines (54 loc) · 1.35 KB
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
44
45
46
47
48
49
50
51
52
53
54
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
testMatch: [
'**/__tests__/**/*.test.ts',
'**/__tests__/**/*.spec.ts',
'**/src/**/*.test.ts',
'**/src/**/*.spec.ts',
],
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
collectCoverage: true,
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/__tests__/'],
coverageReporters: ['text', 'lcov', 'html'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: {
target: 'ES2022',
lib: ['ES2022', 'WebWorker'],
module: 'commonjs',
esModuleInterop: true,
allowSyntheticDefaultImports: true,
strict: true,
types: ['jest', '@cloudflare/workers-types'],
},
},
],
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^workers-og$': '<rootDir>/src/__mocks__/workers-og.ts',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
globals: {
fetch: global.fetch,
Request: global.Request,
Response: global.Response,
Headers: global.Headers,
URL: global.URL,
},
verbose: true,
};