json-assert
Advanced tools
+2
-1
@@ -39,3 +39,2 @@ 'use strict'; | ||
| var len, res, i; | ||
@@ -54,2 +53,4 @@ var fullDst = JSON.stringify(dst, null, 2); | ||
| var len, res, i; | ||
| // if the test has given us a function, evaluate that. | ||
@@ -56,0 +57,0 @@ if (typeof src === 'function') { |
+1
-1
| { | ||
| "name": "json-assert", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "check json object matches template", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+30
-1
@@ -58,3 +58,3 @@ 'use strict'; | ||
| expectedResult, | ||
| "expected(" + expectedResult + ") " + src + " " + dst | ||
| "expected(" + expectedResult + ") " + JSON.stringify(src) + " " + JSON.stringify(dst) | ||
| ); | ||
@@ -123,3 +123,32 @@ } | ||
| it('should check for missing parts', function() { | ||
| var expected = [{ | ||
| name: 'admin', | ||
| isSpecial: true | ||
| }, { | ||
| name: 'everyone', | ||
| isSpecial: true | ||
| }, { | ||
| name: 'testGroup', | ||
| isSpecial: false, | ||
| asdasdasd: 4 // extra param | ||
| }]; | ||
| var actual = [{ | ||
| name: 'admin', | ||
| isSpecial: true | ||
| }, { | ||
| name: 'everyone', | ||
| isSpecial: true | ||
| }, { | ||
| name: 'testGroup', | ||
| isSpecial: false | ||
| }]; | ||
| check(expected, actual, false); | ||
| }); | ||
| }); | ||
| }); |
9675
6.44%233
11.48%