forked from strapi/strapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest-preset.unit.js
More file actions
51 lines (50 loc) · 1.53 KB
/
jest-preset.unit.js
File metadata and controls
51 lines (50 loc) · 1.53 KB
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
'use strict';
module.exports = {
setupFilesAfterEnv: [__dirname + '/tests/setup/unit.setup.js'],
modulePathIgnorePatterns: ['.cache', 'dist'],
testPathIgnorePatterns: [
'.testdata.{js,ts}',
'.test.utils.{js,ts}',
'.d.ts',
'__tests__/resources',
'tests/resources',
// Prevent Jest from running Vitest test files
'.vitest.test.ts',
],
prettierPath: require.resolve('prettier-2'),
testMatch: ['**/__tests__/**/*.{js,ts,jsx,tsx}'],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},
// Use `jest-watch-typeahead` version 0.6.5. Newest version 1.0.0 does not support jest@26
// Reference: https://github.com/jest-community/jest-watch-typeahead/releases/tag/v1.0.0
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
// Coverage configuration for SonarQube
collectCoverage: false, // Will be enabled via CLI flag
collectCoverageFrom: [
'**/*.{js,ts,jsx,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
'!**/dist/**',
'!**/coverage/**',
'!**/*.config.{js,ts,mjs}',
'!**/jest*.{js,ts}',
'!**/rollup*.{js,ts,mjs}',
'!**/babel*.{js,ts}',
'!**/test/**',
'!**/tests/**',
'!**/__tests__/**',
'!**/*.test.{js,ts,jsx,tsx}',
'!**/*.spec.{js,ts,jsx,tsx}',
],
coverageDirectory: '<rootDir>/coverage',
coverageReporters: ['text', 'lcov', 'html'],
coveragePathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/node_modules/',
'<rootDir>/test/',
'<rootDir>/tests/',
'<rootDir>/__tests__/',
'<rootDir>/coverage/',
],
};