Skip to content

Commit

Permalink
Add coverage check to tests (#1669)
Browse files Browse the repository at this point in the history
* check coverage

* Just use `Number.isNaN` as it's widely available

* add test for expected value error in `closeTo`

* raise coverage number to 99
  • Loading branch information
koddsson authored Feb 3, 2025
1 parent da2e109 commit 25bcaab
Show file tree
Hide file tree
Showing 4 changed files with 506 additions and 22 deletions.
21 changes: 1 addition & 20 deletions lib/chai/utils/isNaN.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,4 @@
* MIT Licensed
*/

/**
* ### .isNaN(value)
*
* Checks if the given value is NaN or not.
*
* utils.isNaN(NaN); // true
*
* @param {unknown} value The value which has to be checked if it is NaN
* @returns {boolean}
* @name isNaN
* @private
*/
function _isNaN(value) {
// Refer http://www.ecma-international.org/ecma-262/6.0/#sec-isnan-number
// section's NOTE.
return value !== value;
}

// If ECMAScript 6's Number.isNaN is present, prefer that.
export const isNaN = Number.isNaN || _isNaN;
export const isNaN = Number.isNaN;
Loading

0 comments on commit 25bcaab

Please sign in to comment.