-
Notifications
You must be signed in to change notification settings - Fork 21
/
jest.config.js
44 lines (42 loc) · 1.33 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
module.exports = {
coverageReporters: ['lcov', 'json', 'html'],
collectCoverageFrom: [
'app/src/**/*.{ts,tsx}',
'packages/**/*.{ts,tsx}',
'!app/src/configs/env.ts',
'!app/src/index.tsx',
'!app/src/serviceWorker.ts',
'!**/node_modules/**',
'!**/coverage/**',
'!**/dist/**',
'!**/{tests,__tests__}/**',
],
// these modules are not transpiled to commonjs, they also have un-transpiled scss code
// which is added in the moduleNameMapper config further below
transformIgnorePatterns: [
'node_modules/(?!(@helsenorge/toolkit|@helsenorge/core-utils|@helsenorge/designsystem-react)/)',
],
setupFiles: ['./setupTests', 'jest-canvas-mock'],
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
roots: ['packages/', 'app'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|less|scss)$': 'identity-obj-proxy',
},
testEnvironment: 'jsdom',
testTimeout: 10000,
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
};
// import dotenv from 'dotenv';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const dotenv = require('dotenv');
dotenv.config({ path: './app/.env.test' });
process.env.TZ = 'UTC';