Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Updating some tests to comply with node-fetch updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Aug 26, 2019
1 parent 4f067c9 commit b32e92f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/api-explorer/__tests__/lib/parse-response.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ test('should return `type` from content-type header', async () => {
expect((await parseResponse(har, response)).type).toEqual('application/json');
});

test('should return null for `type` if content-type header missing', async () => {
expect((await parseResponse(har, new Response(responseBody))).type).toEqual(null);
test('should autodetect a content-type if content-type header missing', async () => {
expect((await parseResponse(har, new Response(responseBody))).type).toEqual(
'text/plain;charset=UTF-8',
);
});

test('should remove x-final-url header set by the proxy', async () => {
Expand All @@ -153,7 +155,7 @@ test('should remove x-final-url header set by the proxy', async () => {
headers: { 'x-final-url': 'http://example.com' },
}),
)).responseHeaders,
).toEqual([]);
).toEqual(['content-type: text/plain;charset=UTF-8']);
});

test('should pass through status', async () => {
Expand Down

0 comments on commit b32e92f

Please sign in to comment.