test: favor deepStrictEqual over deepEqual
test-http-mutable-headers uses assert.deepEqual() in three places but appears to only needs it in two of them. Replace one with assert.deepStrictEqual() and remove linting exception. PR-URL: https://github.com/nodejs/node/pull/12883 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
parent
654afa2c19
commit
631cb42b4e
@ -73,17 +73,14 @@ const s = http.createServer(common.mustCall((req, res) => {
|
|||||||
assert.strictEqual(res.getHeader('x-test-header2'), 'testing');
|
assert.strictEqual(res.getHeader('x-test-header2'), 'testing');
|
||||||
|
|
||||||
const headersCopy = res.getHeaders();
|
const headersCopy = res.getHeaders();
|
||||||
assert.strictEqual(Object.getPrototypeOf(headersCopy), null);
|
const expected = {
|
||||||
// eslint-disable-next-line no-restricted-properties
|
|
||||||
assert.deepEqual(headersCopy, {
|
|
||||||
'x-test-header': 'testing',
|
'x-test-header': 'testing',
|
||||||
'x-test-header2': 'testing',
|
'x-test-header2': 'testing',
|
||||||
'set-cookie': cookies,
|
'set-cookie': cookies,
|
||||||
'x-test-array-header': arrayValues
|
'x-test-array-header': arrayValues
|
||||||
});
|
};
|
||||||
// eslint-disable-next-line no-restricted-properties
|
Object.setPrototypeOf(expected, null);
|
||||||
assert.deepEqual(headersCopy['set-cookie'], cookies);
|
assert.deepStrictEqual(headersCopy, expected);
|
||||||
assert.strictEqual(headersCopy['x-test-array-header'], arrayValues);
|
|
||||||
|
|
||||||
assert.deepStrictEqual(res.getHeaderNames(),
|
assert.deepStrictEqual(res.getHeaderNames(),
|
||||||
['x-test-header', 'x-test-header2',
|
['x-test-header', 'x-test-header2',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user