-
Notifications
You must be signed in to change notification settings - Fork 4
/
jest.config.js
45 lines (35 loc) · 1.14 KB
/
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
38
39
40
41
42
43
44
45
const { join } = require('path');
const config = require('@folio/jest-config-stripes');
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
...config,
coverageProvider: 'v8',
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'],
testMatch: ['**/src/**/?(*.)test.{js,jsx,ts,tsx}'],
coverageReporters: ['lcov', 'text'],
collectCoverageFrom: [
'<rootDir>/index.ts',
'<rootDir>/src/**/*.{ts,tsx}',
'!<rootDir>/src/**/*.d.ts',
'!<rootDir>/src/**/*.test.{ts,tsx}',
'!<rootDir>/src/test/**',
'!**/node_modules/**',
],
setupFiles: [
...config.setupFiles,
join(__dirname, './test/setupTests.ts')
],
setupFilesAfterEnv: [join(__dirname, './test/jest.setup.ts')],
preset: 'ts-jest',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
...config.transform
},
moduleNameMapper: {
'^.+\\.(css|svg)$': 'identity-obj-proxy',
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
uuid: require.resolve('uuid'),
},
slowTestThreshold: 10,
testTimeout: 20000,
};