Skip to content

Commit 631cb42

Browse files
committed
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: #12883 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 654afa2 commit 631cb42

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/parallel/test-http-mutable-headers.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,14 @@ const s = http.createServer(common.mustCall((req, res) => {
7373
assert.strictEqual(res.getHeader('x-test-header2'), 'testing');
7474

7575
const headersCopy = res.getHeaders();
76-
assert.strictEqual(Object.getPrototypeOf(headersCopy), null);
77-
// eslint-disable-next-line no-restricted-properties
78-
assert.deepEqual(headersCopy, {
76+
const expected = {
7977
'x-test-header': 'testing',
8078
'x-test-header2': 'testing',
8179
'set-cookie': cookies,
8280
'x-test-array-header': arrayValues
83-
});
84-
// eslint-disable-next-line no-restricted-properties
85-
assert.deepEqual(headersCopy['set-cookie'], cookies);
86-
assert.strictEqual(headersCopy['x-test-array-header'], arrayValues);
81+
};
82+
Object.setPrototypeOf(expected, null);
83+
assert.deepStrictEqual(headersCopy, expected);
8784

8885
assert.deepStrictEqual(res.getHeaderNames(),
8986
['x-test-header', 'x-test-header2',

0 commit comments

Comments
 (0)