forked from govuk-react/govuk-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
36 lines (35 loc) · 1.32 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
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
const { jest: workspaceAliases } = require('workspace-alias');
module.exports = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/{components,packages}/*/src/**.[jt]s?(x)',
'<rootDir>/{components,packages}/*/src/**/*.[jt]s?(x)',
'!<rootDir>/{components,packages}/*/src/**/{stories,example,fixtures,test}.[jt]s?(x)',
'!<rootDir>/packages/storybook/**',
'!<rootDir>/packages/api-docs/**',
'!<rootDir>/packages/example-application/**',
],
coverageDirectory: './coverage/',
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 95,
statements: 95,
},
},
moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx', 'node', 'ts', 'tsx'],
setupFilesAfterEnv: ['<rootDir>/scripts/setupTests.ts'],
snapshotSerializers: ['enzyme-to-json/serializer'],
testEnvironment: 'jsdom',
testMatch: ['**/{components,packages}/*/src/**/?(*.)test.[jt]s?(x)'],
transform: {
'^.+\\.[jt]sx?$': 'babel-jest',
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|mdx)$': 'jest-transform-stub',
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$'],
moduleNameMapper: workspaceAliases(),
};