From 6085021d0c3aaf02491bd7ccf439d8bbd5ee2501 Mon Sep 17 00:00:00 2001 From: jos Date: Tue, 21 Aug 2018 21:32:22 +0200 Subject: [PATCH] Fix more unit tests broken on Nodejs 6 and 8 (no proper NaN assertions) --- test/function/arithmetic/sqrt.test.js | 2 +- test/function/matrix/partitionSelect.test.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/function/arithmetic/sqrt.test.js b/test/function/arithmetic/sqrt.test.js index 6c46ba737..d5fd39d86 100644 --- a/test/function/arithmetic/sqrt.test.js +++ b/test/function/arithmetic/sqrt.test.js @@ -70,7 +70,7 @@ describe('sqrt', function () { }) it('should return NaN if input is NaN', function () { - assert.strictEqual(sqrt(NaN), NaN) + assert(isNaN(sqrt(NaN))) }) it('should throw an error when used with a string', function () { diff --git a/test/function/matrix/partitionSelect.test.js b/test/function/matrix/partitionSelect.test.js index 01f6b9a46..83c149b47 100644 --- a/test/function/matrix/partitionSelect.test.js +++ b/test/function/matrix/partitionSelect.test.js @@ -66,11 +66,11 @@ describe('partitionSelect', function () { }) it('should return NaN if any of the inputs contains NaN', function () { - assert.strictEqual(partitionSelect([NaN], 0), NaN) - assert.strictEqual(partitionSelect([1, NaN], 0), NaN) - assert.strictEqual(partitionSelect([NaN, 1], 0), NaN) - assert.strictEqual(partitionSelect([1, 3, NaN], 1), NaN) - assert.strictEqual(partitionSelect([NaN, NaN, NaN], 1), NaN) + assert(isNaN(partitionSelect([NaN], 0))) + assert(isNaN(partitionSelect([1, NaN], 0))) + assert(isNaN(partitionSelect([NaN, 1], 0))) + assert(isNaN(partitionSelect([1, 3, NaN], 1))) + assert(isNaN(partitionSelect([NaN, NaN, NaN], 1))) }) it('should throw an error if called with a multi dimensional matrix', function () {