Skip to content

Commit

Permalink
test: favor deepStrictEqual over deepEqual
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Trott committed May 11, 2017
1 parent 654afa2 commit 631cb42
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/parallel/test-http-mutable-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,14 @@ const s = http.createServer(common.mustCall((req, res) => {
assert.strictEqual(res.getHeader('x-test-header2'), 'testing');

const headersCopy = res.getHeaders();
assert.strictEqual(Object.getPrototypeOf(headersCopy), null);
// eslint-disable-next-line no-restricted-properties
assert.deepEqual(headersCopy, {
const expected = {
'x-test-header': 'testing',
'x-test-header2': 'testing',
'set-cookie': cookies,
'x-test-array-header': arrayValues
});
// eslint-disable-next-line no-restricted-properties
assert.deepEqual(headersCopy['set-cookie'], cookies);
assert.strictEqual(headersCopy['x-test-array-header'], arrayValues);
};
Object.setPrototypeOf(expected, null);
assert.deepStrictEqual(headersCopy, expected);

assert.deepStrictEqual(res.getHeaderNames(),
['x-test-header', 'x-test-header2',
Expand Down

0 comments on commit 631cb42

Please sign in to comment.