forked from admob-plus/admob-plus
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
jest.config.ts
42 lines (41 loc) · 1.11 KB
/
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
35
36
37
38
39
40
41
42
import {defaults} from 'jest-config';
import type {InitialOptionsTsJest} from 'ts-jest';
import {defaultsESM as tsDefaults} from 'ts-jest/presets';
export default async (): Promise<InitialOptionsTsJest> => ({
preset: 'ts-jest/presets/default-esm',
globals: {
'ts-jest': {
useESM: true,
},
},
moduleNameMapper: {
...defaults.moduleNameMapper,
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
// @ts-expect-error wrong type
...defaults.transform,
...tsDefaults.transform,
'^.+\\.tsx?$': 'ts-jest',
},
testPathIgnorePatterns: [
...defaults.testPathIgnorePatterns,
'/examples/.*/platforms/',
'/examples/.*/plugins/',
'/examples/ionic-angular/',
'/examples/ionic-angular-capacitor',
'/examples/playground/',
].concat(
process.env.WDIO_TEST ? [] : ['/examples/cordova/test/wdio.test.ts']
),
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
testEnvironmentOptions: {
url: 'http://localhost/',
},
moduleFileExtensions: [
'ts',
'tsx',
...(tsDefaults.moduleFileExtensions ?? []),
...defaults.moduleFileExtensions,
],
});