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

@marcbachmannmarcbachmann 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

Copy link
Copy Markdown
CollaboratorAuthor

Included in #50

@marcbachmann
marcbachmann deleted the assert-using-strictEqual branch July 13, 2022 12:49
Sign up for freeto 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.

1 participant

@marcbachmann