forked from zxcvbn-ts/zxcvbn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
29 lines (29 loc) · 997 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
module.exports = {
// test-files end on .test.{} or .spec.{}
// for js, jsx, ts, tsx
testRegex: '((\\.|/)(test|spec))\\.(j|t)sx?$',
coverageDirectory: './test/unit/coverage',
// automatically clear all mocks since preserved mock state
// (e.g. hasBeenCalled) can produce false-negatives
clearMocks: true,
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^~/(.*)$': '<rootDir>/$1',
},
globals: {
'ts-jest': {
// allow settings from a projects babel config
// to be considered in .ts files during test execution
// (e.g. optional-chaining otherwise causes errors in tests)
// https://kulshekhar.github.io/ts-jest/user/config/babelConfig#use-default-babelrc-file
babelConfig: true,
},
},
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.ts$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'json', 'js'],
collectCoverageFrom: ['packages/libraries/main/**/*.{js,ts}'],
coveragePathIgnorePatterns: ['dist', 'test'],
}