Skip to content

Commit 9aa1f75

Browse files
committed
Fix storage test for node
1 parent 033c4dc commit 9aa1f75

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/storage/src/platform/node/connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class FetchStreamConnection extends FetchConnection<
161161
this.sent_ = true;
162162

163163
try {
164-
const response = await this.fetch_(url, {
164+
const response = await fetch(url, {
165165
method,
166166
headers: headers || {},
167167
body: body as NodeJS.ArrayBufferView | string

packages/storage/test/node/connection.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ describe('Connections', () => {
2424
it('FetchConnection.send() should not reject on network errors', async () => {
2525
const connection = new FetchBytesConnection();
2626

27-
// need the casting here because fetch_ is a private member
28-
stub(connection as any, 'fetch_').rejects();
27+
const fetchStub = stub(globalThis, 'fetch').rejects();
2928
await connection.send('testurl', 'GET');
3029
expect(connection.getErrorCode()).to.equal(ErrorCode.NETWORK_ERROR);
30+
fetchStub.restore();
3131
});
3232
});

0 commit comments

Comments
 (0)