Skip to content

Commit

Permalink
Fix network module, tests are broken
Browse files Browse the repository at this point in the history
PR-URL: #253
  • Loading branch information
tshemsedinov authored Apr 26, 2024
1 parent a9563db commit 738d1ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const httpApiCall = async (url, { method = 'POST', headers = {}, body }) => {
const mimeType = 'application/json';
const custom = { ...headers, 'Content-Type': mimeType };
const options = { method, body, headers: custom };
return await fetch(url, options).then((res) => {
return await fetch(url, options).then(async (res) => {
const code = res.status;
if (code === 200) return res.json();
await res.body.cancel();
Expand Down
2 changes: 1 addition & 1 deletion test/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ metatests.test('Network: httpApiCall (POST)', async (test) => {

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

try {
Expand Down

0 comments on commit 738d1ac

Please sign in to comment.