Skip to content

Commit 738d1ac

Browse files
authored
Fix network module, tests are broken
PR-URL: #253
1 parent a9563db commit 738d1ac

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/network.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const httpApiCall = async (url, { method = 'POST', headers = {}, body }) => {
3737
const mimeType = 'application/json';
3838
const custom = { ...headers, 'Content-Type': mimeType };
3939
const options = { method, body, headers: custom };
40-
return await fetch(url, options).then((res) => {
40+
return await fetch(url, options).then(async (res) => {
4141
const code = res.status;
4242
if (code === 200) return res.json();
4343
await res.body.cancel();

test/network.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ metatests.test('Network: httpApiCall (POST)', async (test) => {
124124

125125
const url = `http://localhost:${server.address().port}`;
126126
const headers = { 'Custom-Header': 'custom-value' };
127-
const body = '{"key": "value"}';
127+
const body = '{"key":"value"}';
128128
const method = 'POST';
129129

130130
try {

0 commit comments

Comments
 (0)