Skip to content

test: use assert.strictEqual for equality checks - #3300

Merged
OrKoN merged 1 commit into
test/strict-assert-equalfrom
test/prefer-assert-strict-equal
Oct 22, 2026
Merged

OrKoN merged 1 commit into
test/strict-assert-equalfrom
test/prefer-assert-strict-equal

Conversation

@Lightning00Blade

Copy link
Copy Markdown
Collaborator

Stacked on #3299.

Replaces assert.ok(a === b) and assert.ok(a !== b) with assert.strictEqual(a, b) and assert.notStrictEqual(a, b) in 5 test files, so that a failure shows both values.

WaitForHelper.test.ts uses assert.fail() behind an if instead, because the code after the check relies on the narrowed type and assert.notStrictEqual does not narrow.

This matches the DevTools prefer-assert-strict-equal ESLint rule.

User-visible changes

None. Tests only.

Testing

  • npm run format
  • npm run test

Replace `assert.ok(a === b)` and `assert.ok(a !== b)` with
`assert.strictEqual(a, b)` and `assert.notStrictEqual(a, b)`, so that a
failure shows both values.

`WaitForHelper.test.ts` uses `assert.fail()` behind an `if` instead,
because the code after the check relies on the narrowed type and
`assert.notStrictEqual` does not narrow.

This matches the DevTools `prefer-assert-strict-equal` ESLint rule.
@OrKoN
OrKoN added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 3da5985 Oct 22, 2026
17 checks passed
@OrKoN
OrKoN deleted the test/prefer-assert-strict-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