-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
jest.config.ts
37 lines (34 loc) · 1.13 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
import { Config } from '@jest/types';
import { InitialOptionsTsJest } from 'ts-jest';
// Jest doesn't support ESModules https://github.com/facebook/jest/issues/4842
const ES_MODULE_DEPENDENCIES = [
'@abraham/remotedata',
'@firebase/firestore',
'@firebase/messaging',
'@firebase/util',
'@lit',
'@material',
'firebase',
'lit',
'pwa-helpers',
].join('|');
const config: InitialOptionsTsJest = {
projects: [
{
displayName: 'Web',
preset: 'ts-jest',
setupFilesAfterEnv: ['<rootDir>/__tests__/web.setup.ts'],
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/src/**/*.test.ts'],
transform: { '^.+\\.[t|j]sx?$': 'ts-jest' },
transformIgnorePatterns: [`node_modules/(?!${ES_MODULE_DEPENDENCIES})`],
} as Config.InitialProjectOptions, // InitialProjectOptions thinks `preset` isn't allowed
{
displayName: 'Firestore',
preset: 'ts-jest',
setupFilesAfterEnv: ['<rootDir>/__tests__/firestore.setup.ts'],
testMatch: ['<rootDir>/**/*.rules.test.ts'],
} as Config.InitialProjectOptions, // InitialProjectOptions thinks `preset` isn't allowed
],
};
export default config;