Skip to content

Commit

Permalink
[test] check proper handling with text/plain response.
Browse files Browse the repository at this point in the history
  • Loading branch information
sagrawal-godaddy committed Oct 9, 2018
1 parent 8d4666d commit 25c90e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/fetchUtils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ describe('fetchUtils', () => {
});
});

it('decodes and resolves PLAIN TEXT content', (done) => {
mockResponse.headers.set('content-type', 'text/plain');
handlers.decode(mockResponse).then(data => {
expect(data).toBe(mockTextData);
done();
});
});

it('rejects for unhandled content types', (done) => {
mockResponse.headers.set('content-type', 'some/type');
handlers.decode(mockResponse).catch(data => {
Expand Down

0 comments on commit 25c90e8

Please sign in to comment.