This test passes but results in a problem:
it('should retrieve data on getDownloadProgress() call', (done: DoneFn) => {
let response = {
'process': {},
'success': 'success',
} as IPollResponse;
httpClientSpy.get.and.returnValue(of(response));
service.getDownloadProgress(1)!.subscribe((result: any) => {
expect(result).toEqual(response);
done();
});
});
There is an error that displays when running tests in Jasmine and it falsely indicates test failure:
An error was thrown in afterAll
Error: An asynchronous spec, beforeEach, or afterEach function called its 'done' callback more than once.
The bug that causes this error is fixed in the latest version of zone.js
according to this thread:
https://github.com/angular/angular/issues/45476
@angular/core
depends on zone.js
version 0.11.4
in its peerDependencies
which is revealed in package-lock.json
:
"node_modules/@angular/core": {
"version": "14.2.7",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^14.15.0 || >=16.10.0"
},
"peerDependencies": {
"rxjs": "^6.5.3 || ^7.4.0",
"zone.js": "~0.11.4"
}
},
I believe that if I can force @angular/core
to use the latest version of zone.js
this error will stop appearing.
How can I force @angular/core
to use a specific version of zone.js
?