Skip to content

Commit 8f36b44

Browse files
committed
Merge pull request #9 from wkral/replace-whole-document
Added test for a whole document replacement patch
2 parents 85819b6 + f3ebba0 commit 8f36b44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@
171171
"expected": ["foo", ["bar", "baz"]],
172172
"comment": "value in array replace not flattened" },
173173

174+
{ "comment": "replace whole document",
175+
"doc": {"foo": "bar"},
176+
"patch": [{"op": "replace", "path": "", "value": {"baz": "qux"}}],
177+
"expected": {"baz": "qux"} },
178+
174179
{ "comment": "spurious patch properties",
175180
"doc": {"foo": 1},
176181
"patch": [{"op": "test", "path": "/foo", "value": 1, "spurious": 1}],

0 commit comments

Comments
 (0)