Update to Node 24

Update fetch.ts to use native fetch() API

Use immutable sort in tools.ts
This commit is contained in:
Shivam Mathur
2026-01-20 06:29:00 +05:30
parent f89a301251
commit 46ae35f333
6 changed files with 44 additions and 57 deletions

View File

@@ -19,7 +19,9 @@ it('checking fetch', async () => {
Location: host_url + '/pong'
})
.get('/pong')
.reply(200, 'pong');
.reply(200, 'pong')
.get('/error')
.replyWithError('Network failure');
let response: Record<string, string> = await fetch.fetch(manifest_url);
expect(response.error).toBe(undefined);
@@ -36,4 +38,8 @@ it('checking fetch', async () => {
response = await fetch.fetch(manifest_url, 'invalid_token');
expect(response.error).not.toBe(undefined);
expect(response.data).toBe(undefined);
response = await fetch.fetch(host_url + '/error');
expect(response.error).toContain('Fetch error:');
expect(response.data).toBe(undefined);
});