We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Header
1 parent cb032ea commit 4abbfd2Copy full SHA for 4abbfd2
test/headers.js
@@ -1,3 +1,4 @@
1
+import util from 'util';
2
import {Headers} from '../src/index.js';
3
import chai from 'chai';
4
import chaiIterator from 'chai-iterator';
@@ -232,4 +233,17 @@ describe('Headers', () => {
232
233
expect(() => new Headers('b2')).to.throw(TypeError);
234
expect(() => new Headers({[Symbol.iterator]: 42})).to.throw(TypeError);
235
});
236
+
237
+ it('should use a custom inspect function', () => {
238
+ const headers = new Headers([
239
+ ['Host', 'thehost'],
240
+ ['Host', 'notthehost'],
241
+ ['a', '1'],
242
+ ['b', '2'],
243
+ ['a', '3']
244
+ ]);
245
246
+ // eslint-disable-next-line quotes
247
+ expect(util.format(headers)).to.equal("{ a: [ '1', '3' ], b: '2', host: 'thehost' }");
248
+ });
249
0 commit comments