Skip to content

Commit

Permalink
Fix AbortError test
Browse files Browse the repository at this point in the history
  • Loading branch information
wartab committed Aug 19, 2024
1 parent 52371c4 commit b6c2d3c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/common/http/test/fetch_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ describe('FetchBackend', async () => {
error: (err: HttpErrorResponse) => {
expect(err instanceof HttpErrorResponse).toBe(true);
expect(err.error instanceof DOMException).toBeTrue();
expect((err.error as DOMException).name).toBe('AbortError');
done();
},
});
Expand Down
4 changes: 2 additions & 2 deletions packages/common/http/test/xhr_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ export class MockXMLHttpRequest {
}
}

mockTimeoutEvent(): void {
mockTimeoutEvent(error: any): void {
if (this.listeners.timeout) {
this.listeners.timeout(new ProgressEvent('timeout'));
this.listeners.timeout(error);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/common/http/test/xhr_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe('XhrBackend', () => {
done();
},
});
factory.mock.mockTimeoutEvent();
factory.mock.mockTimeoutEvent(new Error('timeout'));
});
it('avoids abort a request when fetch operation is completed', (done) => {
const abort = jasmine.createSpy('abort');
Expand Down

0 comments on commit b6c2d3c

Please sign in to comment.