This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
67 lines (56 loc) · 1.95 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
const path = require('path')
// for wallaby runtime
module.exports = {
cacheDirectory: './.jest/cache',
collectCoverageFrom: [
'<rootDir>/packages/*/src/**/*.{ts,tsx}',
'<rootDir>/apps/*/src/**/*.{ts,tsx}',
'!<rootDir>/**/*.d.ts',
'!<rootDir>/**/*.stories.{ts,tsx}',
'!<rootDir>/**/__tests__/*.{ts,tsx}',
'!<rootDir>/**/__stories__/*.{ts,tsx}',
'!<rootDir>/**/__mocks__/*.{ts,tsx}',
'!<rootDir>/**/types/**/*.{ts,tsx}',
],
// maxWorkers: '70%',
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'vue', 'json'],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|svg)$': '<rootDir>/__mocks__/file.mock.ts',
'\\.svg$': '<rootDir>/__mocks__/svg.mock.ts',
quasar: 'quasar/dist/quasar.esm.prod',
},
projects: [
{
displayName: 'unit-test',
globals: {
__DEV__: true,
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
snapshotSerializers: ['jest-stitches', '@emotion/jest/serializer'],
testEnvironment: '@happy-dom/jest-environment',
testMatch: [
'!<rootDir>/**/*.e2e.ts',
'<rootDir>/packages/*/src/**/__tests__/*.spec.{ts,tsx}',
'<rootDir>/apps/*/src/**/__tests__/*.spec.{ts,tsx}',
],
transformIgnorePatterns: ['/node_modules/'],
},
],
setupFilesAfterEnv: [path.resolve(__dirname, 'jest.setup.ts')],
snapshotSerializers: ['jest-stitches', '@emotion/jest/serializer'],
testEnvironment: '@happy-dom/jest-environment',
testPathIgnorePatterns: [
'\\.snap$',
'/node_modules/',
'(/__tests__/.*|(\\.|/)(test|spec))\\.d.ts$',
],
// https://github.com/facebook/jest/issues/6766
testURL: 'http://localhost/',
transform: {
'.+\\.(css|styl|less|sass|scss|jpg|jpeg|png|svg|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
require.resolve('jest-transform-stub'),
'^.+\\.jsx?$': require.resolve('babel-jest'),
},
transformIgnorePatterns: ['/node_modules/'],
}