Skip to content

Commit e81d1a5

Browse files
committed
fix(ts-lib-tools): 修复非 monorepo 模式下,单元测试会阻止打包命令执行的错误
closes #23
1 parent 5d279b9 commit e81d1a5

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 变更说明
22

3+
## v0.5.1 - 2019.11.1
4+
5+
- fix(ts-lib-tools): 修复非 monorepo 模式下,单元测试会阻止打包命令执行的错误 ( #23 )
6+
37
## v0.5.0 - 2019.10.21
48

59
- feat(babel-preset-ts-lib): 内置 babel-plugin-styled-components

packages/ts-lib-tools/src/config/create-jest-config.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,6 @@ const monorepoJestConfig = {
1616
'!**/dist/**',
1717
'!**/.cache/**',
1818
],
19-
watchPathIgnorePatterns: [
20-
'node_modules',
21-
'.docz',
22-
'coverage',
23-
'examples',
24-
'.*/node_modules/.*',
25-
'.*/dist/.*',
26-
'.*/\\.cache/.*',
27-
],
28-
testPathIgnorePatterns: [
29-
'.*/node_modules/.*',
30-
'.*/dist/.*',
31-
'.*/\\.cache/.*',
32-
],
3319
};
3420

3521
/**
@@ -59,11 +45,14 @@ export async function createJestConfig() {
5945
],
6046
watchPathIgnorePatterns: [
6147
'node_modules',
62-
'dist',
6348
'.docz',
64-
'.cache',
6549
'coverage',
6650
'examples',
51+
'.cache',
52+
'dist',
53+
'.*/node_modules/.*',
54+
'.*/dist/.*',
55+
'.*/\\.cache/.*',
6756
],
6857
testRegex: '.*\\.(spec|test)\\.tsx?$',
6958
watchPlugins: [
@@ -75,6 +64,11 @@ export async function createJestConfig() {
7564
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
7665
},
7766
resolver: 'jest-resolver-tsconfig-paths',
67+
testPathIgnorePatterns: [
68+
'.*/node_modules/.*',
69+
'.*/dist/.*',
70+
'.*/\\.cache/.*',
71+
],
7872
...(isMono ? monorepoJestConfig : {}),
7973
};
8074

0 commit comments

Comments
 (0)