-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathjest.config.js
38 lines (37 loc) · 1.25 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
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
setupFiles: ['dotenv/config'],
preset: 'ts-jest',
testEnvironment: 'jsdom', //initial was testEnvironment: 'node', using jsdom
rootDir: '.',
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)',
],
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
},
moduleDirectories: ['node_modules', 'src'],
moduleNameMapper: {
'^@popup(.*)$': '<rootDir>/src/popup/$1',
'^@background(.*)$': '<rootDir>/src/background/$1',
'^@interfaces(.*)$': '<rootDir>/src/interfaces/$1',
'^@reference-data(.*)$': '<rootDir>/src/reference-data/$1',
'^@api(.*)$': '<rootDir>/src/api/$1',
'\\.(css|less|scss)$': 'identity-obj-proxy',
'@ledgerhq/devices/hid-framing': '@ledgerhq/devices/lib/hid-framing',
},
modulePaths: ['<rootDir>'],
collectCoverageFrom: ['<rootDir>/**/*.{ts, tsx}'],
collectCoverage: false,
modulePathIgnorePatterns: [
'<rootDir>/src/__tests__/utils-for-testing/',
'mocks',
'othercases',
],
//until here
//working configuration until here E2E/utils/actions tests.
//added new config for background section
setupFilesAfterEnv: ['./jest.setup.js'], //only for jest-chrome
//end added
};