|
@@ -16,8 +16,10 @@ describe('api', function () {
|
|
|
const abort1 = jest.fn();
|
|
|
const abort2 = jest.fn();
|
|
|
|
|
|
- const req1 = new Request(new Promise(() => null), {abort: abort1});
|
|
|
- const req2 = new Request(new Promise(() => null), {abort: abort2});
|
|
|
+ const req1 = new Request(new Promise(() => null), {
|
|
|
+ abort: abort1,
|
|
|
+ } as any);
|
|
|
+ const req2 = new Request(new Promise(() => null), {abort: abort2} as any);
|
|
|
|
|
|
api.activeRequests = {
|
|
|
1: req1,
|
|
@@ -26,8 +28,8 @@ describe('api', function () {
|
|
|
|
|
|
api.clear();
|
|
|
|
|
|
- expect(req1.aborter.abort).toHaveBeenCalledTimes(1);
|
|
|
- expect(req2.aborter.abort).toHaveBeenCalledTimes(1);
|
|
|
+ expect(req1.aborter?.abort).toHaveBeenCalledTimes(1);
|
|
|
+ expect(req2.aborter?.abort).toHaveBeenCalledTimes(1);
|
|
|
});
|
|
|
});
|
|
|
});
|