Skip to content

Commit 22f5713

Browse files
committed
feat(config/jest): ignore dist/ directory
1 parent 617b39a commit 22f5713

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/config/jest.config.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @typedef {import('@jest/types').Config.InitialOptions} JestConfig */
2+
13
const {ifAnyDep, hasAnyDep, hasFile, fromRoot} = require('../utils')
24

35
const ignores = [
@@ -16,6 +18,7 @@ const testMatchSuffixGlob = toGlob(
1618
testMatchExtensions.map(extension => 'test.'.concat(extension)),
1719
)
1820

21+
/** @type JestConfig */
1922
const jestConfig = {
2023
roots: [fromRoot('.')],
2124
testEnvironment: ifAnyDep(['webpack', 'rollup', 'react'], 'jsdom', 'node'),
@@ -29,9 +32,17 @@ const jestConfig = {
2932
`e2e/**/${testMatchSuffixGlob}`,
3033
`**/${testMatchSuffixGlob}`,
3134
],
32-
testPathIgnorePatterns: [...ignores],
33-
coveragePathIgnorePatterns: [...ignores, 'src/(umd|cjs|esm)-entry.js$'],
34-
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
35+
testPathIgnorePatterns: [...ignores, '<rootDir>/dist'],
36+
coveragePathIgnorePatterns: [
37+
...ignores,
38+
'src/(umd|cjs|esm)-entry.js$',
39+
'<rootDir>/dist',
40+
],
41+
transformIgnorePatterns: [
42+
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$',
43+
'/dist/',
44+
],
45+
watchPathIgnorePatterns: ['<rootDir>/dist'],
3546
coverageThreshold: {
3647
global: {
3748
branches: 100,

0 commit comments

Comments
 (0)