Skip to content

Commit af9d914

Browse files
committed
chore(jest): split up jest configuration
1 parent 8756498 commit af9d914

5 files changed

Lines changed: 29 additions & 5 deletions

File tree

jest.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module.exports = {
22
globals: {
33
'ts-jest': {
4-
tsConfig:
5-
'<rootDir>/projects/pretty-html-log-showcase/tsconfig.spec.json',
64
stringifyContentPathRegex: '\\.html$',
75
astTransformers: [
86
'<rootDir>/node_modules/jest-preset-angular/InlineHtmlStripStylesTransformer'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"build": "ng build",
88
"format:check": "prettier --list-different 'projects/**/*.ts'",
99
"format:write": "prettier --write 'projects/**/*.ts'",
10-
"test": "jest",
11-
"test:showcase": "ng test pretty-html-log-showcase",
10+
"test:lib": "jest --config ./projects/pretty-html-log/jest.config.js",
11+
"test:showcase": "jest --config ./projects/pretty-html-log-showcase/jest.config.js",
1212
"lint": "ng lint",
1313
"e2e": "ng e2e"
1414
},
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const baseConfig = require('../../jest.config.js');
2+
3+
module.exports = {
4+
...baseConfig,
5+
globals: {
6+
'ts-jest': {
7+
...baseConfig.globals['ts-jest'],
8+
tsConfig: '<rootDir>/projects/pretty-html-log-showcase/tsconfig.spec.json'
9+
}
10+
},
11+
roots: ['<rootDir>/projects/pretty-html-log-showcase/src'],
12+
rootDir: '../../'
13+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const baseConfig = require('../../jest.config.js');
2+
3+
module.exports = {
4+
...baseConfig,
5+
globals: {
6+
'ts-jest': {
7+
...baseConfig.globals['ts-jest'],
8+
tsConfig: '<rootDir>/projects/pretty-html-log/tsconfig.spec.json'
9+
}
10+
},
11+
roots: ['<rootDir>/projects/pretty-html-log/src'],
12+
rootDir: '../../'
13+
};

projects/pretty-html-log/tsconfig.spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../out-tsc/spec",
5-
"types": ["jasmine", "node"]
5+
"types": ["jest", "node"]
66
},
77
"files": [],
88
"include": ["**/*.spec.ts", "**/*.d.ts"]

0 commit comments

Comments
 (0)