-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathjest.e2e.config.js
More file actions
43 lines (43 loc) · 1.28 KB
/
Copy pathjest.e2e.config.js
File metadata and controls
43 lines (43 loc) · 1.28 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
/** @type {import('jest').Config} */
export default {
preset: 'ts-jest',
extensionsToTreatAsEsm: ['.ts', '.tsx'],
// IMPORTANT: Do NOT mock ink or ink-testing-library in E2E
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^ink$': '<rootDir>/node_modules/ink/build/index.js',
'^ink-testing-library$': '<rootDir>/node_modules/ink-testing-library/build/index.js',
'^ink-syntax-highlight$': '<rootDir>/node_modules/ink-syntax-highlight/build/index.js'
},
// Transform ESM in node_modules used by Ink and its deps
transformIgnorePatterns: [],
transform: {
'^.+\\.tsx?$': ['ts-jest', {
useESM: true,
tsconfig: {
module: 'ES2022',
target: 'ES2022'
}
}],
// Transform ESM JS from node_modules (ink, ink-testing-library)
'^.+\\.(mjs|js)$': ['babel-jest', {
presets: [[
'@babel/preset-env',
{targets: {node: 'current'}}
]]
}]
},
testEnvironment: 'node',
// Use a lighter setup for E2E (no global fake timers)
setupFilesAfterEnv: ['<rootDir>/tests/setup.e2e.ts'],
testMatch: [
'<rootDir>/tests/e2e/**/*.test.{ts,tsx}',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
],
clearMocks: true,
resetMocks: true
};