Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace assert.deepEqual with assert.deepStrictEqual #37

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

ijlee2
Copy link
Owner

@ijlee2 ijlee2 commented Jun 9, 2023

Description

While documenting @codemod-utils/tests, I learned that assert.deepEqual is an alias of assert.deepStrictEqual and the latter should be used to avoid unexpected results.

Strict assertion mode

An alias of assert.deepStrictEqual().

Legacy assertion mode

Stability: 3 - Legacy: Use assert.deepStrictEqual() instead.

Tests for deep equality between the actual and expected parameters. Consider using assert.deepStrictEqual() instead. assert.deepEqual() can have surprising results.

https://nodejs.org/api/assert.html#assertdeepequalactual-expected-message

@ijlee2 ijlee2 added the enhance: code Issue asks for new feature or refactor label Jun 9, 2023
@ijlee2 ijlee2 marked this pull request as ready for review June 9, 2023 10:18
@ijlee2 ijlee2 merged commit d54cd84 into main Jun 9, 2023
@ijlee2 ijlee2 deleted the remove-assert-deepEqual branch June 9, 2023 10:19
@ijlee2 ijlee2 changed the title Replaced assert.deepEqual with assert.deepStrictEqual Replace assert.deepEqual with assert.deepStrictEqual Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhance: code Issue asks for new feature or refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant