-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
/
jest.config.js
37 lines (34 loc) · 1001 Bytes
/
jest.config.js
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 { testConfig } from './server.configs.js';
const { hostname, port } = testConfig;
const TEST_HOST = `http://${hostname}:${port}`;
const sharedConfig = {
errorOnDeprecated: true,
globalSetup: './test/config/jest.setup.js',
globalTeardown: './test/config/jest.teardown.js',
prettierPath: null, // Fix for Jest v29 and Prettier v3 (https://github.com/jestjs/jest/issues/14305)
resetModules: true,
restoreMocks: true,
setupFilesAfterEnv: ['<rootDir>/test/config/jest.setup-tests.js'],
testEnvironment: 'jest-environment-jsdom',
testEnvironmentOptions: {
url: `${TEST_HOST}/_blank.html`,
},
};
process.env.TEST_HOST = TEST_HOST;
export default {
transform: {},
projects: [
// Unit Tests
{
displayName: 'unit',
...sharedConfig,
testMatch: ['<rootDir>/test/unit/*.test.js'],
},
// Integration Tests
{
displayName: 'integration',
...sharedConfig,
testMatch: ['<rootDir>/test/integration/*.test.js'],
},
],
};