Skip to content

Always use strictEqual to ensure null and undefined values are asserted correctly - #59

Closed
marcbachmann wants to merge 1 commit into
mainfrom
assert-using-strictEqual
Closed

Always use strictEqual to ensure null and undefined values are asserted correctly#59
marcbachmann wants to merge 1 commit into
mainfrom
assert-using-strictEqual

Conversation

@marcbachmann

@marcbachmann marcbachmann commented Jan 21, 2022

Copy link
Copy Markdown
Collaborator

Just saw that some assertions were wrong.
assert.equal is deprecated and behaves slightly different with null/undefined.

const obj = {a: 'foo'}
// This returned undefined, but accepted null in the comparison
- assert.equal(jsonpointer.get(obj, '/b'), null)
+ assert.strictEqual(jsonpointer.get(obj, '/b'), undefined)

Migrating everything to assert.strictEqual is more explicit.

@marcbachmann
marcbachmann requested a review from janl January 21, 2022 23:58
@marcbachmann

Copy link
Copy Markdown
Collaborator Author

Included in #50

@marcbachmann
marcbachmann deleted the assert-using-strictEqual branch July 13, 2022 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant