Checklist
What happened?
The package currently uses BrowserDynamicTestingModule from @angular/platform-browser-dynamic/testing, which has been deprecated in Angular 20. Since this package only declares it as a devDependency and it is not installed by default anymore, running tests will raise an error claiming that package could not be found.
Instead of adding it as a peerDependency, I'd recommend replacing it with BrowserTestingModule from @angular/platform-browser/testing instead. This follows the Angular Teams migration suggestion.
Steps to reproduce
- Create an Angular 22 project from scratch
- Install the latest @openng/spectator package
- Use spectator in a test spec
- run tests, observe error
Expected behavior
Spectator does not declare dependencies, so no further installation of packages should be necessary.
Actual behavior
We have to install @angular/platform-browser-dynamic for spectator to work.
Minimal reproduction
https://github.com/MelGidsen/spectator-missing-declaration
Library version
1.0.1
Angular version
>=22.0.0
Node version
24.18.0
Package manager
npm
Browser(s)
Chrome
Environment details
Angular application setup
None
Angular context
Relevant log output
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL spectator-missing-declaration src/app/to-string.pipe.spec.ts [ src/app/to-string.pipe.spec.ts ]
Error: Cannot find package '@angular/platform-browser-dynamic' imported from C:\Users\gaida\Workspace\Projekte\adease\openng-spectator-bug\spectator-missing-declaration\node_modules\@openng\spectator\fesm2022\openng-spectator.mjs
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
Screenshots
No response
Additional context
No response
Checklist
What happened?
The package currently uses
BrowserDynamicTestingModulefrom @angular/platform-browser-dynamic/testing, which has been deprecated in Angular 20. Since this package only declares it as a devDependency and it is not installed by default anymore, running tests will raise an error claiming that package could not be found.Instead of adding it as a peerDependency, I'd recommend replacing it with BrowserTestingModule from @angular/platform-browser/testing instead. This follows the Angular Teams migration suggestion.
Steps to reproduce
Expected behavior
Spectator does not declare dependencies, so no further installation of packages should be necessary.
Actual behavior
We have to install @angular/platform-browser-dynamic for spectator to work.
Minimal reproduction
https://github.com/MelGidsen/spectator-missing-declaration
Library version
1.0.1
Angular version
>=22.0.0
Node version
24.18.0
Package manager
npm
Browser(s)
Chrome
Environment details
- Test Runner: VitestAngular application setup
None
Angular context
Relevant log output
Screenshots
No response
Additional context
No response