-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathjest.config.ts
More file actions
30 lines (28 loc) · 1.01 KB
/
Copy pathjest.config.ts
File metadata and controls
30 lines (28 loc) · 1.01 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
import type { JestConfigWithTsJest } from 'ts-jest';
import generatedTestPatterns from './scripts/generated-test-patterns.json';
const config: JestConfigWithTsJest = {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
setupFiles: ['<rootDir>/scripts/jest-setup.ts'],
testMatch: generatedTestPatterns.map(
(pattern) => `<rootDir>/${pattern}${pattern.endsWith('.test.ts') ? '' : '/**/*.test.ts'}`,
),
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }],
'^.+\\.cts$': ['@swc/jest', { sourceMaps: 'inline' }],
},
moduleNameMapper: {
'^#x509-transport-state$': '<rootDir>/src/internal/auth/x509-transport-state.cts',
'^openai$': '<rootDir>/src/index.ts',
'^openai/(.*)$': '<rootDir>/src/$1',
},
modulePathIgnorePatterns: [
'<rootDir>/ecosystem-tests/',
'<rootDir>/dist/',
'<rootDir>/deno/',
'<rootDir>/deno_tests/',
'<rootDir>/packages/',
],
testPathIgnorePatterns: ['scripts', '<rootDir>/tests/live/'],
};
export default config;