Skip to content

Commit 9ab0c30

Browse files
committed
compare serialised results (to ignore functions)
1 parent 0d54233 commit 9ab0c30

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,14 @@ function jsonScriptTest(jsInterpreters, opts) {
5757

5858
function testResult(res) {
5959
if (test.result !== undefined) {
60-
var method = typeof res == 'object' && res !== null
61-
? 'deepStrictEqual'
62-
: 'strictEqual';
60+
var method;
61+
if (typeof res == 'object' && res !== null) {
62+
method = 'deepStrictEqual';
63+
res = JSON.parse(JSON.stringify(res));
64+
} else {
65+
method = 'strictEqual';
66+
}
67+
6368
try {
6469
assert[method](res, test.result);
6570
suiteHooks(true, res);

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsonscript-test",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Testing JSONScript scripts using test suites",
55
"main": "index.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
"dependencies": {
2424
"ajv": "^3.7.0",
2525
"glob": "^7.0.0",
26-
"jsonscript": "^0.2.0",
27-
"jsonscript-test-suite": "^0.1.0"
26+
"jsonscript": "^0.2.2",
27+
"jsonscript-test-suite": "^0.2.2"
2828
}
2929
}

0 commit comments

Comments
 (0)