Skip to content

Commit

Permalink
build(devs-infra): restructure unit test config (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl committed Aug 21, 2020
1 parent 4af013f commit d499303
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 26 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,12 @@ Override `globals` object in Jest config:
"ts-jest": {
"tsConfig": "<rootDir>/tsconfig.custom.json",
"stringifyContentPathRegex": "\\.html$",
"astTransformers": [
"jest-preset-angular/build/InlineFilesTransformer",
"jest-preset-angular/build/StripStylesTransformer"
],
"astTransformers": {
"before": [
"jest-preset-angular/build/InlineFilesTransformer",
"jest-preset-angular/build/StripStylesTransformer"
]
}
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @typedef {import('ts-jest')} */
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
preset: 'ts-jest',
globals: {
'ts-jest': {
tsConfig: 'tsconfig.spec.json',
},
},
testPathIgnorePatterns: ['/e2e/'],
};
9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@
"post-commit": "git reset"
}
},
"jest": {
"preset": "ts-jest",
"globals": {
"ts-jest": {
"tsConfig": "<rootDir>/tsconfig.spec.json"
}
},
"rootDir": "src/__tests__"
},
"lint-staged": {
"*.{ts,js}": [
"eslint --fix",
Expand Down
10 changes: 0 additions & 10 deletions src/__tests__/tsconfig.spec.json

This file was deleted.

6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"allowJs": true,
"allowSyntheticDefaultImports": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": true,
"noImplicitReturns": true,
"importsNotUsedAsValues": "error",
"skipLibCheck": true,
"removeComments": true,
"lib": ["esnext"],
"types": ["node"]
}
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["jest", "node"]
},
"include": [] // boost test's speed trick
}

0 comments on commit d499303

Please sign in to comment.