Skip to content

Commit 345181e

Browse files
committed
chore(transloco): 🤖 use ts jest config
1 parent de24d71 commit 345181e

File tree

3 files changed

+27
-35
lines changed

3 files changed

+27
-35
lines changed

libs/transloco/jest.config.schematics.js

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { Config } from 'jest';
2+
3+
export default {
4+
displayName: 'transloco-schematics',
5+
testEnvironment: 'node',
6+
preset: '../../jest.preset.js',
7+
globals: {},
8+
transform: {
9+
'^.+\\.[tj]sx?$': [
10+
'ts-jest',
11+
{
12+
tsconfig: '<rootDir>/tsconfig.spec.json',
13+
},
14+
],
15+
},
16+
testMatch: ['<rootDir>/schematics/**/*.spec.ts'],
17+
moduleNameMapper: {
18+
'^@jsverse/transloco-utils$': '<rootDir>/../transloco-utils/src/index.ts',
19+
},
20+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
21+
coverageDirectory: '../../coverage/libs/transloco-schematics',
22+
collectCoverageFrom: ['schematics/**/*.ts', '!schematics/**/*.spec.ts'],
23+
} as Config;

libs/transloco/project.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@
3939
"outputs": ["{workspaceRoot}/dist/libs/transloco"]
4040
},
4141
"test": {
42-
"dependsOn": ["test-karma", "test-jest"],
42+
"dependsOn": ["test-library", "test-schematics"],
4343
"executor": "nx:noop"
4444
},
45-
"test-karma": {
45+
"test-library": {
4646
"executor": "@angular-devkit/build-angular:karma",
4747
"options": {
4848
"main": "libs/transloco/src/test-setup.ts",
4949
"tsConfig": "libs/transloco/tsconfig.spec.json",
5050
"karmaConfig": "libs/transloco/karma.conf.js"
5151
}
5252
},
53-
"test-jest": {
53+
"test-schematics": {
5454
"executor": "@nx/jest:jest",
5555
"outputs": ["{options.outputFile}"],
5656
"options": {
57-
"jestConfig": "libs/transloco/jest.config.schematics.js",
57+
"jestConfig": "libs/transloco/jest.config.schematics.ts",
5858
"passWithNoTests": true
5959
}
6060
},

0 commit comments

Comments
 (0)