Test @@toStringTag getter of all classes

This commit is contained in:
Timothy Gu 2016-10-10 12:41:13 -07:00
parent 0f65af3fd8
commit 4d81cb4877
1 changed files with 15 additions and 0 deletions

View File

@ -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: {