generated from WarstekHUN/typescript-npm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.multi.config.cjs
More file actions
29 lines (29 loc) · 1.23 KB
/
jest.multi.config.cjs
File metadata and controls
29 lines (29 loc) · 1.23 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
/** Multi-project Jest config: unit + puppeteer */
module.exports = {
// Global coverage reporters (applies to merged result)
coverageReporters: ['json-summary', 'text', 'lcov'],
projects: [
{
displayName: 'unit',
testEnvironment: 'node',
roots: ['<rootDir>/test'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)'
],
// Ignore any puppeteer-designated files so they are only run in the browser project
testPathIgnorePatterns: ['.*\\.puppeteer\\.test\\.(ts|js)$', 'puppeteer\\.test\\.(ts|js)$'],
transform: { '^.+\\.(ts|tsx)$': 'ts-jest' },
// Modern ts-jest config style (instead of deprecated globals usage) can be added via options array if needed.
// Example: transform: { '^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: 'tsconfig.json' }] }
},
{
displayName: 'browser',
preset: 'jest-puppeteer',
roots: ['<rootDir>/test'],
// Include both *.puppeteer.test.* and a legacy puppeteer.test.* filename
testMatch: ['**/*.puppeteer.test.ts', '**/*.puppeteer.test.js', '**/puppeteer.test.ts', '**/puppeteer.test.js'],
transform: { '^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: 'tsconfig.json' }] }
}
]
};