-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathjest.config.ts
More file actions
43 lines (41 loc) · 887 Bytes
/
jest.config.ts
File metadata and controls
43 lines (41 loc) · 887 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/** @jest-config-loader esbuild-register */
import type { Config } from 'jest'
const config: Config = {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/WAProto'],
testMatch: ['<rootDir>/src/**/*.test.ts'],
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: {
module: 'esnext',
allowJs: true,
verbatimModuleSyntax: false,
allowImportingTsExtensions: false,
},
},
],
'^.+\\.js$': [
'ts-jest',
{
useESM: true,
tsconfig: {
module: 'esnext',
allowJs: true,
verbatimModuleSyntax: false,
},
},
],
},
transformIgnorePatterns: [
'node_modules/(?!(protobufjs|long|@protobufjs|@types/long|whatsapp-rust-bridge)/)',
],
}
export default config