Skip to content

Conversation

@GaneshSPatil
Copy link
Contributor

To check whether the reference value is NaN or not.

For Example:

expect(NaN).to.be.NaN();
expect(1).not.to.be.NaN();

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a difference between the behavior of isNaN() and Number.isNaN(). Since this is only targeting the NaN value, this should use Number.isNaN(). Please add a test that asserts a string to see the difference.

API.md Outdated

##### `NaN()`

Asserts that the reference value is NaN.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NaN should be in backticks.

lib/index.js Outdated

internals.addMethod('NaN', function () {

return this.assert(isNaN(this._ref), 'be NaN');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isNaN() -> Number.isNaN()

@cjihrig
Copy link
Contributor

cjihrig commented Nov 18, 2016

This still needs a test for a string.

@cjihrig cjihrig added the feature New functionality or improvement label Nov 23, 2016
@cjihrig cjihrig added this to the 4.1.0 milestone Nov 23, 2016
@cjihrig cjihrig self-assigned this Nov 23, 2016
@cjihrig
Copy link
Contributor

cjihrig commented Nov 23, 2016

Landed with some edits in 3d9dfc3.

@cjihrig cjihrig closed this Nov 23, 2016
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants