[gjs: 1/10] tests: Use Jasmine's toBeNaN() matcher
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/10] tests: Use Jasmine's toBeNaN() matcher
- Date: Sun, 6 Mar 2022 00:46:42 +0000 (UTC)
commit 4545bcae67bd4679b97196a86c7d616cc39e16cc
Author: Philip Chimento <philip chimento gmail com>
Date: Fri Feb 11 20:44:11 2022 -0800
tests: Use Jasmine's toBeNaN() matcher
This is designed for this purpose, use it for conciseness instead of
Number.isNaN().
installed-tests/js/testRegress.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/installed-tests/js/testRegress.js b/installed-tests/js/testRegress.js
index 36d062b28..249b69e02 100644
--- a/installed-tests/js/testRegress.js
+++ b/installed-tests/js/testRegress.js
@@ -78,7 +78,7 @@ describe('Life, the Universe and Everything', function () {
expect(Regress[method](-42)).toBe(-42);
if (['float', 'double'].includes(type)) {
- expect(Number.isNaN(Regress[method](undefined))).toBeTruthy();
+ expect(Regress[method](undefined)).toBeNaN();
expect(Regress[method](42.42)).toBeCloseTo(42.42);
expect(Regress[method](-42.42)).toBeCloseTo(-42.42);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]