Skip to content

Commit b98502e

Browse files
committed
chore: [capricorn86#1718] Adds fixes related to AbortSignal and Fetch
1 parent 95cdd3e commit b98502e

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

packages/happy-dom/src/fetch/AbortSignal.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default class AbortSignal extends EventTarget {
9090
: new this[PropertySymbol.window].DOMException(
9191
'signal is aborted without reason',
9292
DOMExceptionNameEnum.abortError
93-
);
93+
);
9494
this[PropertySymbol.aborted] = true;
9595
this.dispatchEvent(new Event('abort'));
9696
}
@@ -118,7 +118,7 @@ export default class AbortSignal extends EventTarget {
118118
: new this[PropertySymbol.window].DOMException(
119119
'signal is aborted without reason',
120120
DOMExceptionNameEnum.abortError
121-
);
121+
);
122122
signal[PropertySymbol.aborted] = true;
123123
return signal;
124124
}

packages/happy-dom/src/fetch/Fetch.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export default class Fetch {
154154
window: this.#window,
155155
response: this.response,
156156
request: this.request
157-
})
157+
})
158158
: undefined;
159159
return interceptedResponse instanceof Response ? interceptedResponse : this.response;
160160
}
@@ -341,7 +341,7 @@ export default class Fetch {
341341
window: this.#window,
342342
response: await response,
343343
request: this.request
344-
})
344+
})
345345
: undefined;
346346
this.#browserFrame[PropertySymbol.asyncTaskManager].endTask(taskID);
347347
return interceptedResponse instanceof Response ? interceptedResponse : response;
@@ -364,7 +364,7 @@ export default class Fetch {
364364
window: this.#window,
365365
response: await response,
366366
request: this.request
367-
})
367+
})
368368
: undefined;
369369
this.#browserFrame[PropertySymbol.asyncTaskManager].endTask(taskID);
370370
return interceptedResponse instanceof Response ? interceptedResponse : response;
@@ -388,7 +388,7 @@ export default class Fetch {
388388
window: this.#window,
389389
response: await response,
390390
request: this.request
391-
})
391+
})
392392
: undefined;
393393

394394
this.#browserFrame[PropertySymbol.asyncTaskManager].endTask(taskID);
@@ -545,7 +545,7 @@ export default class Fetch {
545545
window: this.#window,
546546
response: await response,
547547
request: this.request
548-
})
548+
})
549549
: undefined;
550550
this.#browserFrame[PropertySymbol.asyncTaskManager].endTask(taskID);
551551
const returnResponse =

packages/happy-dom/src/fetch/SyncFetch.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default class SyncFetch {
104104
? this.interceptor.beforeSyncRequest({
105105
request: this.request,
106106
window: this.#window
107-
})
107+
})
108108
: undefined;
109109

110110
if (typeof beforeRequestResponse === 'object') {
@@ -139,7 +139,7 @@ export default class SyncFetch {
139139
window: this.#window,
140140
response,
141141
request: this.request
142-
})
142+
})
143143
: undefined;
144144
return typeof interceptedResponse === 'object' ? interceptedResponse : response;
145145
}
@@ -293,7 +293,7 @@ export default class SyncFetch {
293293
window: this.#window,
294294
response,
295295
request: this.request
296-
})
296+
})
297297
: undefined;
298298
return typeof interceptedResponse === 'object' ? interceptedResponse : response;
299299
}
@@ -312,7 +312,7 @@ export default class SyncFetch {
312312
window: this.#window,
313313
response,
314314
request: this.request
315-
})
315+
})
316316
: undefined;
317317
return typeof interceptedResponse === 'object' ? interceptedResponse : response;
318318
}
@@ -331,7 +331,7 @@ export default class SyncFetch {
331331
window: this.#window,
332332
response,
333333
request: this.request
334-
})
334+
})
335335
: undefined;
336336
const returnResponse = typeof interceptedResponse === 'object' ? interceptedResponse : response;
337337

@@ -528,7 +528,7 @@ export default class SyncFetch {
528528
window: this.#window,
529529
response: redirectedResponse,
530530
request: this.request
531-
})
531+
})
532532
: undefined;
533533
const returnResponse =
534534
typeof interceptedResponse === 'object' ? interceptedResponse : redirectedResponse;

packages/happy-dom/test/fetch/Fetch.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { ReadableStream } from 'stream/web';
1717
import { afterEach, describe, it, expect, vi } from 'vitest';
1818
import FetchHTTPSCertificate from '../../src/fetch/certificate/FetchHTTPSCertificate.js';
1919
import * as PropertySymbol from '../../src/PropertySymbol.js';
20-
import { abort } from 'process';
2120

2221
const LAST_CHUNK = Buffer.from('0\r\n\r\n');
2322

0 commit comments

Comments
 (0)