Skip to content

Commit 79c91e0

Browse files
committed
(test): Update project to Angular 16 and Jest
This commit updates the Akita Filters Plugin's Angular dependencies to version 16. there are updates made to improve some eslint config, several package dependencies, and minor tsconfig and test script changes in package.json. Please be aware this is a breaking change because of the Angular version update.
1 parent 33e6c8b commit 79c91e0

File tree

7 files changed

+352
-390
lines changed

7 files changed

+352
-390
lines changed

jest.config.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ const jestConfig: Config = {
44
verbose: true,
55
preset: "jest-preset-angular",
66
setupFilesAfterEnv: ["<rootDir>/projects/setup-jest.ts"],
7-
globalSetup: "jest-preset-angular/global-setup",
87
moduleFileExtensions: ["ts", "html", "js", "json", "mjs"],
8+
transform: {
9+
'^.+\\.(ts|mjs|js|html)$': [
10+
'jest-preset-angular',
11+
{
12+
tsconfig: '<rootDir>/tsconfig.spec.json',
13+
stringifyContentPathRegex: '\\.(html|svg)$',
14+
},
15+
],
16+
},
917
transformIgnorePatterns: [
10-
"node_modules/(?!.*\\.mjs$)"
18+
"node_modules/(?!.*\\.mjs$|@datorama/akita/*|tslib|rxjs)"
1119
],
1220
modulePathIgnorePatterns: [ "<rootDir>/dist"],
1321
moduleNameMapper: {

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "ng build --configuration production --output-path docs --base-href /akita-filters-plugin/",
88
"compile": "ng build akita-filters-plugin --configuration production",
99
"compile:datasource": "ng build akita-mat-datasource --configuration production",
10-
"test": "jest --runInBand",
10+
"test": "jest --ci",
1111
"test:debug": "node --inspect-brk ./node_modules/.bin/jest --runInBand --watch",
1212
"test:watch": "jest --watch",
1313
"lint": "ng lint",
@@ -58,21 +58,21 @@
5858
"@angular/cli": "16.2.12",
5959
"@angular/compiler-cli": "16.2.12",
6060
"@angular/language-service": "16.2.12",
61-
"@jest/globals": "^28.1.3",
62-
"@types/jest": "^28.1.8",
63-
"@types/node": "^12.11.1",
61+
"@jest/globals": "^29.7.0",
62+
"@types/jest": "^29.5.12",
63+
"@types/node": "^16.18.82",
6464
"@typescript-eslint/eslint-plugin": "4.28.2",
6565
"@typescript-eslint/parser": "4.28.2",
6666
"eslint": "^7.26.0",
6767
"jest": "^29.7.0",
68-
"jest-localstorage-mock": "^2.4.22",
69-
"jest-preset-angular": "^12.2.2",
68+
"jest-localstorage-mock": "^2.4.26",
69+
"jest-preset-angular": "^14.0.3",
7070
"ng-packagr": "^16.2.3",
7171
"protractor": "~7.0.0",
7272
"semantic-release": "^17.3.8",
7373
"semantic-release-npm-github-publish": "^1.5.1",
74-
"ts-jest": "^28.0.8",
75-
"ts-node": "~9.1.1",
74+
"ts-jest": "^29.1.2",
75+
"ts-node": "~10.9.2",
7676
"typescript": "~4.9.5"
7777
},
7878
"repository": {

projects/akita-filters-plugin/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"keywords": ["angular", "ngx", "akita", "filters", "state management"],
66
"version": "0.0.0-dev",
77
"peerDependencies": {
8-
"@datorama/akita": ">=4.0.0",
9-
"@angular/common": ">=11.0.0",
10-
"@angular/core": ">=11.0.0"
8+
"@datorama/akita": ">=8.0.0",
9+
"@angular/common": ">=16.0.0",
10+
"@angular/core": ">=16.0.0"
1111
},
1212
"repository": {
1313
"type": "git",

projects/akita-mat-datasource/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"angular", "ngx", "akita", "filters", "state management", "angular material", "matDatasource", "angular material data source"],
77
"version": "0.0.0-dev",
88
"peerDependencies": {
9-
"@datorama/akita": ">=4.0.0",
10-
"@angular/common": ">=11.0.0",
11-
"@angular/core": ">=11.0.0",
12-
"@angular/material": ">=11.0.0"
9+
"@datorama/akita": ">=8.0.0",
10+
"@angular/common": ">=16.0.0",
11+
"@angular/core": ">=16.0.0",
12+
"@angular/material": ">=16.0.0"
1313
},
1414
"repository": {
1515
"type": "git",

src/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, NgZone, OnInit } from '@angular/core';
1+
import { Component, NgZone } from '@angular/core';
22
import { environment } from '../environments/environment';
33

44
@Component({

src/tsconfig.spec.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/spec",
5+
"module": "ES2022",
56
"types": [
6-
"jasmine",
7+
"jest",
78
"node"
89
]
910
},
10-
"files": [
11-
"test.ts",
12-
"polyfills.ts"
13-
],
1411
"include": [
12+
"jest.config.ts",
1513
"**/*.spec.ts",
16-
"**/*.d.ts"
14+
"**/*.d.ts",
15+
"src/polyfills.ts"
1716
]
1817
}

0 commit comments

Comments
 (0)