-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
34 lines (32 loc) · 972 Bytes
/
jest.config.ts
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
import type { Config } from 'jest';
import { compilerOptions } from './tsconfig.json';
export default async (): Promise<Config> => {
return {
roots: ['<rootDir>'],
rootDir: './',
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
// preset: 'ts-jest/presets/default-esm',
preset: 'ts-jest',
extensionsToTreatAsEsm: ['.ts'],
modulePaths: [compilerOptions.baseUrl],
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
isolatedModules: false,
// supportsStaticESM: true,
diagnostics: {
warnOnly: true,
},
},
],
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testEnvironment: 'jsdom',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
};
};