File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ describe('validate', function() {
38
38
expect ( error ) . toBeUndefined ( ) ;
39
39
} ) ;
40
40
41
- it ( 'should return an error if the patch is not an array' , function ( ) {
42
- var error = jsonpatch . validate ( { } ) ;
43
- expect ( error instanceof jsonpatch . JsonPatchError ) . toBe ( true ) ;
44
- expect ( error . name ) . toBe ( 'SEQUENCE_NOT_AN_ARRAY' ) ;
45
- expect ( error . message ) . toBe ( 'Patch sequence must be an array' ) ;
41
+ it ( 'applyPatch should throw an error if the patch is not an array and validate is `true` ' , function ( ) {
42
+ expect ( ( ) => jsonpatch . applyPatch ( { } , { } , true ) ) . toThrow ( new jsonpatch . JsonPatchError ( 'Patch sequence must be an array' ) ) ;
43
+ } ) ;
44
+ it ( 'applyPatch should throw an error if the patch is not an array and validate is `true`' , function ( ) {
45
+ expect ( ( ) => jsonpatch . applyPatch ( { } , null , true ) ) . toThrow ( new jsonpatch . JsonPatchError ( 'Patch sequence must be an array' ) ) ;
46
46
} ) ;
47
47
48
48
it ( 'should return an empty array if the operation is a valid object' , function ( ) {
You can’t perform that action at this time.
0 commit comments