-
Notifications
You must be signed in to change notification settings - Fork 57
/
jest.config.js
67 lines (57 loc) · 1.75 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
63
64
65
66
67
module.exports = {
// The root of your source code, typically /src
// `<rootDir>` is a token Jest substitutes
roots: ['<rootDir>/src'],
automock: false,
// Jest transformations -- this adds support for TypeScript
// using ts-jest
transform: {
'^.+\\.tsx?$': 'ts-jest',
'\\.svg$': '<rootDir>/__mocks__/svgMock.js',
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$',
'^.+\\.module\\.(css|sass|scss)$',
],
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/types.{ts,tsx}',
'!src/**/fixtures.ts',
'!src/core/constants/*.{ts,tsx}',
'!src/generated/*.{ts,tsx}',
'!src/styles/**',
'!src/pages/__devOnly/*.{ts,tsx}',
],
coverageReporters: ['text', 'lcov'],
collectCoverage: false, // set to true to collect coverage
coverageThreshold: {
'src/hooks/ui/useShortcuts.tsx': {
statements: 90,
},
},
testEnvironment: 'jsdom',
// Load setup files before test execution
setupFilesAfterEnv: ['./jest-setup.ts'],
// Test spec file resolution pattern
// Matches parent folder `__tests__` and filename
// should contain `test` or `spec`.
testMatch: ['<rootDir>/src/**/__tests__/**/*.{spec,test}.{ts,tsx}'],
modulePaths: [],
moduleNameMapper: {
'^~/(.*)$': '<rootDir>/src/$1',
'ace-builds': '<rootDir>/node_modules/ace-builds',
},
// Module file extensions for importing
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
globals: {
APP_ENV: 'production',
API_URL: 'http://localhost:3000',
DOMAIN: 'localhost',
APP_VERSION: '1.0.0',
IS_REACT_ACT_ENVIRONMENT: true,
LAGO_OAUTH_PROXY_URL: 'https://proxy.lago.dev',
LAGO_DISABLE_SIGNUP: 'false',
NANGO_PUBLIC_KEY: '',
SENTRY_DSN: 'https://sentry.io/',
},
}