Skip to content

Commit cccbd24

Browse files
author
James Halliday
committed
turn examples into tests, everything passes
1 parent 3e5363a commit cccbd24

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

test/nested.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var test = require('tape');
2+
var stringify = require('../');
3+
4+
test('nested', function (t) {
5+
t.plan(1);
6+
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
7+
t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}');
8+
});

test/str.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var test = require('tape');
2+
var stringify = require('../');
3+
4+
test('simple object', function (t) {
5+
t.plan(1);
6+
var obj = { c: 6, b: [4,5], a: 3 };
7+
t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6}');
8+
});

0 commit comments

Comments
 (0)