-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathjest.config.js
More file actions
71 lines (70 loc) · 2.08 KB
/
jest.config.js
File metadata and controls
71 lines (70 loc) · 2.08 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const baseConfig = {
moduleNameMapper: {
'^@jbrowse/core/util/useMeasure$':
'<rootDir>/packages/__mocks__/@jbrowse/core/util/useMeasure.ts',
'^@jbrowse/core/ui/SanitizedHTML$':
'<rootDir>/packages/__mocks__/@jbrowse/core/ui/SanitizedHTML.tsx',
'^@jbrowse/text-indexing-core$':
'<rootDir>/packages/text-indexing-core/src/index.ts',
},
transform: {
'^.+\\.(ts|tsx|js|jsx)$': '<rootDir>/config/jest/babelTransform.cjs',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.cjs',
},
transformIgnorePatterns: [
'/node_modules/.+\\.(js|jsx)$',
'\\.module\\.(css|sass|scss)$',
],
collectCoverageFrom: [
'{packages,products,plugins}/*/src/**/*.{js,jsx,ts,tsx}',
],
coveragePathIgnorePatterns: [
'!*.d.ts',
'makeWorkerInstance.ts',
'react-colorful.js',
'QuickLRU.js',
],
setupFiles: [
'<rootDir>/config/jest/textEncoder.js',
'<rootDir>/config/jest/console.js',
'<rootDir>/config/jest/messagechannel.js',
'<rootDir>/config/jest/structuredClone.js',
],
testEnvironmentOptions: { url: 'http://localhost' },
testTimeout: 15000,
}
export default {
projects: [
{
// Root-level integration test
displayName: 'integration',
testMatch: ['<rootDir>/integration.test.js'],
testEnvironment: 'node',
...baseConfig,
},
{
// jbrowse-img uses Node environment with native fetch (no jest-fetch-mock)
displayName: 'jbrowse-img',
testMatch: ['<rootDir>/products/jbrowse-img/**/*.test.ts'],
testPathIgnorePatterns: ['/dist/', '/cypress/', '/demos/'],
testEnvironment: 'node',
...baseConfig,
},
{
// All other tests use jsdom with jest-fetch-mock
displayName: 'default',
testMatch: [
'<rootDir>/{packages,products,plugins}/**/*.test.{ts,tsx,js,jsx}',
],
testPathIgnorePatterns: [
'/dist/',
'/cypress/',
'/demos/',
'<rootDir>/products/jbrowse-img/',
],
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/config/jest/fetchMockAfterEnv.js'],
...baseConfig,
},
],
}