Skip to content

Commit

Permalink
(test): Update project to Angular 16 and Jest
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
manudss committed Feb 16, 2024
1 parent 33e6c8b commit 79c91e0
Show file tree
Hide file tree
Showing 7 changed files with 352 additions and 390 deletions.
12 changes: 10 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ const jestConfig: Config = {
verbose: true,
preset: "jest-preset-angular",
setupFilesAfterEnv: ["<rootDir>/projects/setup-jest.ts"],
globalSetup: "jest-preset-angular/global-setup",
moduleFileExtensions: ["ts", "html", "js", "json", "mjs"],
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: [
"node_modules/(?!.*\\.mjs$)"
"node_modules/(?!.*\\.mjs$|@datorama/akita/*|tslib|rxjs)"
],
modulePathIgnorePatterns: [ "<rootDir>/dist"],
moduleNameMapper: {
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "ng build --configuration production --output-path docs --base-href /akita-filters-plugin/",
"compile": "ng build akita-filters-plugin --configuration production",
"compile:datasource": "ng build akita-mat-datasource --configuration production",
"test": "jest --runInBand",
"test": "jest --ci",
"test:debug": "node --inspect-brk ./node_modules/.bin/jest --runInBand --watch",
"test:watch": "jest --watch",
"lint": "ng lint",
Expand Down Expand Up @@ -58,21 +58,21 @@
"@angular/cli": "16.2.12",
"@angular/compiler-cli": "16.2.12",
"@angular/language-service": "16.2.12",
"@jest/globals": "^28.1.3",
"@types/jest": "^28.1.8",
"@types/node": "^12.11.1",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.12",
"@types/node": "^16.18.82",
"@typescript-eslint/eslint-plugin": "4.28.2",
"@typescript-eslint/parser": "4.28.2",
"eslint": "^7.26.0",
"jest": "^29.7.0",
"jest-localstorage-mock": "^2.4.22",
"jest-preset-angular": "^12.2.2",
"jest-localstorage-mock": "^2.4.26",
"jest-preset-angular": "^14.0.3",
"ng-packagr": "^16.2.3",
"protractor": "~7.0.0",
"semantic-release": "^17.3.8",
"semantic-release-npm-github-publish": "^1.5.1",
"ts-jest": "^28.0.8",
"ts-node": "~9.1.1",
"ts-jest": "^29.1.2",
"ts-node": "~10.9.2",
"typescript": "~4.9.5"
},
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions projects/akita-filters-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"keywords": ["angular", "ngx", "akita", "filters", "state management"],
"version": "0.0.0-dev",
"peerDependencies": {
"@datorama/akita": ">=4.0.0",
"@angular/common": ">=11.0.0",
"@angular/core": ">=11.0.0"
"@datorama/akita": ">=8.0.0",
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0"
},
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions projects/akita-mat-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"angular", "ngx", "akita", "filters", "state management", "angular material", "matDatasource", "angular material data source"],
"version": "0.0.0-dev",
"peerDependencies": {
"@datorama/akita": ">=4.0.0",
"@angular/common": ">=11.0.0",
"@angular/core": ">=11.0.0",
"@angular/material": ">=11.0.0"
"@datorama/akita": ">=8.0.0",
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0",
"@angular/material": ">=16.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, NgZone, OnInit } from '@angular/core';
import { Component, NgZone } from '@angular/core';
import { environment } from '../environments/environment';

@Component({
Expand Down
11 changes: 5 additions & 6 deletions src/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"module": "ES2022",
"types": [
"jasmine",
"jest",
"node"
]
},
"files": [
"test.ts",
"polyfills.ts"
],
"include": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.d.ts"
"**/*.d.ts",
"src/polyfills.ts"
]
}
Loading

0 comments on commit 79c91e0

Please sign in to comment.