Test @@toStringTag getter of all classes
This commit is contained in:
parent
0f65af3fd8
commit
4d81cb4877
15
test/test.js
15
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() {
|
it('should accept custom host header', function() {
|
||||||
url = `${base}inspect`;
|
url = `${base}inspect`;
|
||||||
opts = {
|
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() {
|
it('should support wrapping Request instance', function() {
|
||||||
url = `${base}hello`;
|
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() {
|
it('should support parsing headers in Response constructor', function() {
|
||||||
const res = new Response(null, {
|
const res = new Response(null, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
Loading…
Reference in New Issue