forked from HumanSignal/label-studio-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
62 lines (62 loc) · 1.7 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
bail: true,
roots: ['<rootDir>/src'],
preset: 'ts-jest',
setupFilesAfterEnv: ['./jest.setup.js'],
testEnvironment: 'jsdom',
verbose: false,
collectCoverageFrom: ['**/*.{js,jsx,ts,tsx}', '!**/*.d.ts', '!**/node_modules/**', '!**/examples/**'],
coverageDirectory: 'coverage',
coverageReporters: ['json'],
coverageThreshold: {
global: {
branches: 1,
functions: 1,
lines: 1,
statements: 1,
},
},
transform: {
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: [
[
'@babel/preset-react',
{
runtime: 'automatic',
},
],
'@babel/preset-typescript',
[
'@babel/preset-env',
{
targets: {
browsers: ['last 2 Chrome versions'],
node: 'current',
},
},
],
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-private-methods',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
},
],
},
moduleFileExtensions: ['js', 'ts', 'jsx', 'tsx'],
moduleDirectories: ['node_modules'],
moduleNameMapper: {
'^konva': 'konva/konva',
'^keymaster': 'identity-obj-proxy',
'^react-konva-utils': 'identity-obj-proxy',
'\\.(s[ac]ss|css|styl|svg|png|jpe?g)$': 'identity-obj-proxy',
},
testPathIgnorePatterns: ['/node_modules/', '/e2e/'],
testRegex: '__tests__/.*.test.[tj]sx?',
transformIgnorePatterns: ['node_modules/?!(nanoid|konva)'],
};