forked from microsoft/accessibility-insights-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.base.js
51 lines (51 loc) · 1.82 KB
/
jest.config.base.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
module.exports = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/**/*.js',
'<rootDir>/**/*.ts',
'<rootDir>/**/*.tsx',
'!<rootDir>/bundle/**',
'!<rootDir>/dist/**',
'!<rootDir>/drop/**',
'!<rootDir>/extension/**',
'!<rootDir>/out/**',
'!<rootDir>/**/jest.config.js',
'!<rootDir>/**/prettier.config.js',
'!<rootDir>/**/webpack.config.js',
'!<rootDir>/**/esbuild.js',
'!<rootDir>/**/style-config.js',
'!<rootDir>/**/node_modules/**',
'!<rootDir>/**/test-results/**',
],
coverageDirectory: '<rootDir>/test-results/unit/coverage',
coverageReporters: ['text', 'lcov', 'cobertura'],
displayName: '<should be overriden by individual jest.configs>',
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['ts', 'js', 'json'],
moduleNameMapper: {
/* Using proxy to handle css modules, as per: https://jestjs.io/docs/en/webpack#mocking-css-modules */
'\\.(scss)$': `${__dirname}/src/tests/common/identity-obj-proxy`,
},
reporters: [
'default',
'github-actions',
[
'jest-junit',
{
outputDirectory: '<rootDir>/test-results/unit',
outputName: 'junit.xml',
},
],
],
setupFilesAfterEnv: [`${__dirname}/src/tests/common/flush-promises-after-each-test.ts`],
snapshotSerializers: [`${__dirname}/src/tests/common/typemoq-snapshot-serializer.ts`],
testEnvironment: 'node',
testMatch: ['**/*.spec.[tj]s', '**/*.test.[tj]s'],
testPathIgnorePatterns: ['/dist/', '/out/'],
transform: {
'^.+\\.(ts|tsx|js|jsx)$': ['@swc/jest'],
},
};