Skip to content

Commit d5dbcfa

Browse files
committed
test: NaN, Infinity values
1 parent 67f688f commit d5dbcfa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
.nyc_output/
33
coverage/
4+
.DS_Store

test/str.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ test('object with null', function (t) {
2121
t.equal(stringify(obj), '{"a":3,"z":null}');
2222
});
2323

24+
test('object with NaN and Infinity', function (t) {
25+
t.plan(1);
26+
var obj = { a: 3, b: NaN, c: Infinity };
27+
t.equal(stringify(obj), '{"a":3,"b":null,"c":null}');
28+
});
29+
2430
test('array with undefined', function (t) {
2531
t.plan(1);
2632
var obj = [4, undefined, 6];

0 commit comments

Comments
 (0)