Skip to content

Commit

Permalink
feat: upgrade to Angular 17
Browse files Browse the repository at this point in the history
- ran ng update @angular/cli @angular/core
- updated eslint dependencies
- updated jest dependencies
  • Loading branch information
Ismaïl Ouazzany committed Nov 28, 2023
1 parent 9478289 commit 777c67e
Show file tree
Hide file tree
Showing 6 changed files with 3,332 additions and 2,993 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ The `createComponent()` method returns an instance of `Spectator` which exposes
- `component` - The tested component's instance
- `element` - The tested component's native element
- `debugElement` - The tested fixture's debug element
- `flushEffects()` - Provides a wrapper for `TestBed.flushEffects()`

- `inject()` - Provides a wrapper for `TestBed.inject()`:
- `inject()` - Provides a wrapper for `TestBed.inject()`
```ts
const service = spectator.inject(QueryService);

Expand Down
53 changes: 27 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@
"release:dry": "cd projects/spectator && standard-version --infile ../../CHANGELOG.md --dry-run"
},
"devDependencies": {
"@angular-builders/jest": "^16.0.0",
"@angular-devkit/build-angular": "^16.0.0",
"@angular-devkit/schematics": "^16.0.0",
"@angular-eslint/builder": "16.0.1",
"@angular-eslint/eslint-plugin": "16.0.1",
"@angular-eslint/eslint-plugin-template": "16.0.1",
"@angular-eslint/schematics": "16.0.1",
"@angular-eslint/template-parser": "16.0.1",
"@angular/animations": "^16.0.0",
"@angular/cdk": "^16.0.0",
"@angular/cli": "^16.0.0",
"@angular/common": "^16.0.0",
"@angular/compiler": "^16.0.0",
"@angular/compiler-cli": "^16.0.0",
"@angular/core": "^16.0.0",
"@angular/forms": "^16.0.0",
"@angular/language-service": "^16.0.0",
"@angular/platform-browser": "^16.0.0",
"@angular/platform-browser-dynamic": "^16.0.0",
"@angular/router": "16.0.0",
"@angular-builders/jest": "^17.0.0",
"@angular-devkit/build-angular": "^17.0.1",
"@angular-devkit/schematics": "^17.0.1",
"@angular-eslint/builder": "17.1.0",
"@angular-eslint/eslint-plugin": "17.1.0",
"@angular-eslint/eslint-plugin-template": "17.1.0",
"@angular-eslint/schematics": "17.1.0",
"@angular-eslint/template-parser": "17.1.0",
"@angular/animations": "^17.0.3",
"@angular/cdk": "^17.0.1",
"@angular/cli": "^17.0.1",
"@angular/common": "^17.0.3",
"@angular/compiler": "^17.0.3",
"@angular/compiler-cli": "^17.0.3",
"@angular/core": "^17.0.3",
"@angular/forms": "^17.0.3",
"@angular/language-service": "^17.0.3",
"@angular/platform-browser": "^17.0.3",
"@angular/platform-browser-dynamic": "^17.0.3",
"@angular/router": "17.0.3",
"@commitlint/cli": "17.3.0",
"@commitlint/config-angular": "17.3.0",
"@commitlint/config-conventional": "17.3.0",
"@types/jasmine": "3.8.1",
"@types/jest": "29.5.2",
"@types/jest": "29.5.10",
"@types/node": "18.16.5",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
Expand All @@ -68,21 +68,22 @@
"husky": "^8.0.2",
"jasmine-core": "3.8.0",
"jasmine-spec-reporter": "7.0.0",
"jest": "29.5.0",
"jest-preset-angular": "13.1.1",
"jest": "29.7.0",
"jest-preset-angular": "13.1.4",
"karma": "6.3.4",
"karma-chrome-launcher": "3.1.0",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-jasmine": "4.0.1",
"karma-jasmine-html-reporter": "1.7.0",
"lint-staged": "^13.1.0",
"ng-packagr": "16.0.0",
"ng-packagr": "17.0.1",
"prettier": "2.3.2",
"rxjs": "6.6.3",
"standard-version": "^9.1.0",
"ts-node": "10.1.0",
"typescript": "5.0.4",
"zone.js": "0.13.0"
"tslib": "^2.6.2",
"typescript": "5.2.2",
"zone.js": "0.14.2"
},
"config": {
"commitizen": {
Expand Down
6 changes: 3 additions & 3 deletions projects/spectator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"tslib": "^2.1.0"
},
"peerDependencies": {
"@angular/common": ">= 16.0.0",
"@angular/router": ">= 16.0.0",
"@angular/animations": ">= 16.0.0"
"@angular/common": ">= 17.0.0",
"@angular/router": ">= 17.0.0",
"@angular/animations": ">= 17.0.0"
},
"schematics": "./schematics/collection.json"
}
7 changes: 7 additions & 0 deletions projects/spectator/src/lib/base/base-spectator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ export abstract class BaseSpectator {
public inject<T>(token: Token<T>): SpyObject<T> {
return TestBed.inject ? TestBed.inject(token) : TestBed.get(token);
}

/**
* Execute any pending effects.
*/
public flushEffects(): void {
TestBed.flushEffects();
}
}
2 changes: 1 addition & 1 deletion projects/spectator/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"declaration": true,
"inlineSources": true,
"typeRoots": [
"../../node_modules/@types",
"./typings"
],
"types": [
"jasmine",
"jest",
"node"
],
Expand Down
Loading

0 comments on commit 777c67e

Please sign in to comment.