Repository navigation
test: replace assert.equal with assert.strictEqual - #3299
Merged
Merged
Conversation
`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
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3298.
assert.equalfromnode:assertcompares with==, so for exampleassert.equal(1, '1')passes. Replaces its 153 uses in 13 test files withassert.strictEqual. Three of the files importnode: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-equalESLint rule. Its autofix is not used because it rewrites comparisons against object and array literals toassert.deepEqual, which is also loose innode:assert.User-visible changes
None. Tests only.
Testing
npm run formatnpm run test