-
Notifications
You must be signed in to change notification settings - Fork 787
/
jest.config.js
68 lines (68 loc) · 2.85 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
68
module.exports = {
moduleNameMapper: {
'@app-data': '<rootDir>/internal/app-data/index.cjs',
'@app-globals': '<rootDir>/internal/app-globals/index.cjs',
'@platform': '<rootDir>/internal/testing/index.js',
'@runtime': '<rootDir>/internal/testing/index.js',
'@stencil/core/cli': '<rootDir>/cli/index.cjs',
'@stencil/core/compiler': '<rootDir>/compiler/stencil.js',
'@stencil/core/mock-doc': '<rootDir>/mock-doc/index.cjs',
'@stencil/core/testing': '<rootDir>/testing/index.js',
'@sys-api-node': '<rootDir>/sys/node/index.js',
'@utils': '<rootDir>/src/utils',
'^typescript$': '<rootDir>/scripts/build/typescript-modified-for-jest.js',
'^@stencil/core/internal/app-data$': '<rootDir>/internal/app-data/index.cjs',
'^@stencil/core/internal/testing$': '<rootDir>/internal/testing/index.js',
},
coverageDirectory: './coverage/',
coverageReporters: ['json', 'lcov', 'text', 'clover'],
coveragePathIgnorePatterns: ['^.*\\.stub\\.tsx?$'],
collectCoverageFrom: [
'<rootDir>/scripts/**/*.{js,jsx,ts,tsx}',
'!<rootDir>/scripts/build/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/app-data/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/app-globals/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/cli/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/compiler/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/declarations/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/dev-server/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/hydrate/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/internal/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/mock-doc/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/runtime/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/screenshot/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/sys/node/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/testing/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/utils/**/*.{js,jsx,ts,tsx}',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'mjs', 'jsx', 'json', 'd.ts'],
modulePathIgnorePatterns: ['/bin', '/www'],
setupFilesAfterEnv: ['<rootDir>/testing/jest-setuptestframework.js'],
testEnvironment: '<rootDir>/testing/jest-environment.js',
testPathIgnorePatterns: [
'<rootDir>/.cache/',
'<rootDir>/.github/',
'<rootDir>/.stencil/',
'<rootDir>/.vscode/',
'<rootDir>/bin/',
'<rootDir>/build/',
'<rootDir>/cli/',
'<rootDir>/compiler/',
'<rootDir>/dev-server/',
'<rootDir>/dist/',
'<rootDir>/internal/',
'<rootDir>/mock-doc/',
'<rootDir>/node_modules/',
'<rootDir>/screenshot/',
'<rootDir>/sys/',
'<rootDir>/test/',
'<rootDir>/testing/',
],
testRegex: '/(src|scripts)/.*\\.spec\\.(ts|tsx|js)$',
// TODO(STENCIL-307): Move away from Jasmine runner for internal Stencil tests as a part of the (internal) Jest 28+ upgrade
testRunner: 'jest-jasmine2',
transform: {
'^.+\\.(ts|tsx|jsx|css|mjs)$': '<rootDir>/testing/jest-preprocessor.js',
},
watchPathIgnorePatterns: ['^.+\\.d\\.ts$'],
};