Skip to content

test: replace assert.equal with assert.strictEqual - #3299

Merged
OrKoN merged 1 commit into
test/remove-manual-sinon-restorefrom
test/strict-assert-equal
Oct 22, 2026
Merged

OrKoN merged 1 commit into
test/remove-manual-sinon-restorefrom
test/strict-assert-equal

Conversation

@Lightning00Blade

Copy link
Copy Markdown
Collaborator

Stacked on #3298.

assert.equal from node:assert compares with ==, so for example assert.equal(1, '1') passes. Replaces its 153 uses in 13 test files with assert.strictEqual. Three of the files import node:assert/strict, where the two are the same; the rename keeps the files consistent. No test relied on the loose comparison.

This matches the DevTools no-assert-equal ESLint rule. Its autofix is not used because it rewrites comparisons against object and array literals to assert.deepEqual, which is also loose in node:assert.

User-visible changes

None. Tests only.

Testing

  • npm run format
  • npm run test

`assert.equal` from `node:assert` compares with `==`. Replace its 153
uses in 13 test files with `assert.strictEqual`. Three of the files
import `node:assert/strict`, where the two are the same; the rename
keeps the files consistent.

This matches the DevTools `no-assert-equal` ESLint rule. Its autofix is
not used because it rewrites comparisons against object and array
literals to `assert.deepEqual`, which is also loose in `node:assert`.
@OrKoN
OrKoN added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit d0a2306 Oct 22, 2026
17 checks passed
@OrKoN
OrKoN deleted the test/strict-assert-equal branch October 22, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants