-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.ts
More file actions
27 lines (22 loc) · 784 Bytes
/
jest.config.ts
File metadata and controls
27 lines (22 loc) · 784 Bytes
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
import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
// 1. Compile TS with ts-jest, and JS with babel-jest
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.m?js$': 'babel-jest',
},
// 2. CRITICAL: Tell Jest to compile 'franc' and its dependencies
// (Usually Jest ignores everything in node_modules, this overrides that for specific folders)
transformIgnorePatterns: [
'node_modules/(?!(franc|iso-639-3|trigram-utils|n-gram|collapse-white-space)/)'
],
// 3. Standard Setup
clearMocks: true,
collectCoverage: true,
coverageDirectory: 'coverage',
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'],
testMatch: ['**/tests/**/*.ts', '**/?(*.)+(spec|test).ts'],
};
export default config;