-
Notifications
You must be signed in to change notification settings - Fork 138
/
jest.config.ts
34 lines (31 loc) · 1.09 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
import { InitialProjectOptions } from '@jest/types/build/Config';
import { InitialOptionsTsJest } from 'ts-jest';
// Jest doesn't support ESModules https://github.com/facebook/jest/issues/4842
const ES_MODULE_DEPENDENCIES = [
'@abraham/remotedata',
'@lit',
'@material',
'lit',
'pwa-helpers',
'testing-library__dom',
].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 InitialProjectOptions, // InitialProjectOptions thinks `preset` isn't allowed
{
displayName: 'Firestore',
preset: 'ts-jest',
setupFilesAfterEnv: ['<rootDir>/__tests__/firestore.setup.ts'],
testMatch: ['<rootDir>/**/*.rules.test.ts'],
} as InitialProjectOptions, // InitialProjectOptions thinks `preset` isn't allowed
],
};
export default config;