forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
30 lines (27 loc) · 946 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
// https://jestjs.io/docs/en/configuration.html
const isActions = Boolean(process.env.GITHUB_ACTIONS)
const reporters = ['default', 'github-actions']
export default {
preset: 'ts-jest',
coverageThreshold: {
global: {
branches: 95,
functions: 95,
lines: 95,
statements: -5,
},
},
moduleNameMapper: {
// fix for "Unexpected token 'export'" error when running jest
'@primer/behaviors': '<rootDir>/node_modules/@primer/behaviors/dist/cjs/index.js',
},
reporters,
// modulePathIgnorePatterns: ['assets/'],
setupFilesAfterEnv: ['./jest.setup.js', 'jest-expect-message'],
testEnvironment: 'node',
testPathIgnorePatterns: ['node_modules/', 'vendor/', 'tests/fixtures/', 'tests/helpers/'],
testMatch: ['**/tests/**/*.js'],
testLocationInResults: isActions,
globalSetup: './src/tests/scripts/start-server-for-jest.js',
globalTeardown: './src/tests/scripts/kill-server-for-jest.js',
}