Skip to content

Commit 5405313

Browse files
nicksnyderbruth
authored andcommitted
Add tests for replacing the root document (#30)
* Add tests for replacing the root document * Use add operation since deleting root document is undefined
1 parent 716417e commit 5405313

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@
5555
"expected": "bar",
5656
"disabled": true },
5757

58+
{ "comment": "replace object document with array document?",
59+
"doc": {},
60+
"patch": [{"op": "add", "path": "", "value": []}],
61+
"expected": [] },
62+
63+
{ "comment": "replace array document with object document?",
64+
"doc": [],
65+
"patch": [{"op": "add", "path": "", "value": {}}],
66+
"expected": {} },
67+
68+
{ "comment": "append to root array document?",
69+
"doc": [],
70+
"patch": [{"op": "add", "path": "/-", "value": "hi"}],
71+
"expected": ["hi"] },
72+
5873
{ "comment": "Add, / target",
5974
"doc": {},
6075
"patch": [ {"op": "add", "path": "/", "value":1 } ],

0 commit comments

Comments
 (0)