Skip to content

Commit 24c983a

Browse files
committed
Fix test suite
1 parent 54889c1 commit 24c983a

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"test": {
2828
"builder": "@angular-builders/jest:run",
2929
"options": {
30-
"tsConfig": "lib/tsconfig.spec.json"
30+
"tsConfig": "./tsconfig.spec.json"
3131
}
3232
},
3333
"lint": {

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
preset: 'jest-preset-angular',
3-
globalSetup: 'jest-preset-angular/global-setup',
43
moduleNameMapper: {
54
'angular-reactive-state/(.*)': ['<rootDir>/lib/src/$1'],
5+
'^lodash-es$': 'lodash',
66
},
77
};

lib/jest.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ var baseConfig = require('../jest.config');
22

33
module.exports = Object.assign(baseConfig, {
44
preset: 'jest-preset-angular',
5-
globals: {
6-
'ts-jest': {
7-
tsconfig: '<rootDir>/tsconfig.spec.json',
8-
},
5+
transform: {
6+
'^.+\\.tsx?$': [
7+
'ts-jest',
8+
{
9+
tsconfig: './tsconfig.spec.json',
10+
},
11+
],
912
},
1013
});

lib/src/store/store.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Store', () => {
6060

6161
it('should trigger state changes via custom actions', () => {
6262
const stateValue = store.snapshot.a;
63-
expect(stateValue).toEqual({ a: 'update a' });
63+
expect(stateValue).toEqual({ a: 'a' });
6464
store.update(
6565
state => ({
6666
...state,

lib/tsconfig.spec.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../out-tsc/spec",
5-
"types": [
6-
"jest"
7-
]
5+
"types": ["jest", "node"]
86
},
9-
"include": [
10-
"**/*.spec.ts",
11-
"**/*.d.ts"
12-
]
7+
"include": ["**/*.spec.ts", "**/*.d.ts"]
138
}

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@angular/cli": "~17.1.3",
7171
"@angular/compiler-cli": "^17.1.3",
7272
"@schuchard/prettier": "^5.1.0",
73-
"@types/jest": "29.5.12",
73+
"@types/jest": "^29.5.12",
7474
"@types/lodash-es": "^4.17.12",
7575
"@typescript-eslint/eslint-plugin": "6.21.0",
7676
"@typescript-eslint/parser": "6.21.0",
@@ -80,6 +80,7 @@
8080
"jest-preset-angular": "^14.0.2",
8181
"ng-packagr": "^17.1.2",
8282
"prettier": "latest",
83+
"ts-jest": "^29.1.2",
8384
"tslint-config-prettier": "latest",
8485
"typescript": "~5.3.3"
8586
}

0 commit comments

Comments
 (0)