diff --git a/test/test.js b/test/test.js index 753290c..444ca1f 100644 --- a/test/test.js +++ b/test/test.js @@ -171,6 +171,11 @@ describe('node-fetch', () => { }); }); + it('should support proper toString output for Headers instance', function() { + const headers = new Headers(); + expect(headers.toString()).to.equal('[object Headers]'); + }); + it('should accept custom host header', function() { url = `${base}inspect`; opts = { @@ -1300,6 +1305,11 @@ describe('node-fetch', () => { }); }); + it('should support proper toString output for Request instance', function() { + const req = new Request(base); + expect(req.toString()).to.equal('[object Request]'); + }); + it('should support wrapping Request instance', function() { url = `${base}hello`; @@ -1355,6 +1365,11 @@ describe('node-fetch', () => { }); }); + it('should support proper toString output for Response instance', function() { + const res = new Response(); + expect(res.toString()).to.equal('[object Response]'); + }); + it('should support parsing headers in Response constructor', function() { const res = new Response(null, { headers: {