forked from immerjs/immer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use snapshots in createDraft tests
- Loading branch information
1 parent
44ef0c8
commit 13b0ed0
Showing
2 changed files
with
108 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`manual - es5 cannot modify after finish 1`] = `"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":2}"`; | ||
|
||
exports[`manual - es5 should check arguments 1`] = `"First argument to createDraft should be a plain object, an array, or an immerable object."`; | ||
|
||
exports[`manual - es5 should check arguments 2`] = `"First argument to createDraft should be a plain object, an array, or an immerable object."`; | ||
|
||
exports[`manual - es5 should check arguments 3`] = `"First argument to finishDraft should be an object from createDraft."`; | ||
|
||
exports[`manual - es5 should support patches drafts 1`] = ` | ||
Array [ | ||
Array [ | ||
Array [ | ||
Object { | ||
"op": "replace", | ||
"path": Array [ | ||
"a", | ||
], | ||
"value": 2, | ||
}, | ||
Object { | ||
"op": "add", | ||
"path": Array [ | ||
"b", | ||
], | ||
"value": 3, | ||
}, | ||
], | ||
Array [ | ||
Object { | ||
"op": "replace", | ||
"path": Array [ | ||
"a", | ||
], | ||
"value": 1, | ||
}, | ||
Object { | ||
"op": "remove", | ||
"path": Array [ | ||
"b", | ||
], | ||
}, | ||
], | ||
], | ||
] | ||
`; | ||
|
||
exports[`manual - proxy cannot modify after finish 1`] = `"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? {\\"a\\":2}"`; | ||
|
||
exports[`manual - proxy should check arguments 1`] = `"First argument to createDraft should be a plain object, an array, or an immerable object."`; | ||
|
||
exports[`manual - proxy should check arguments 2`] = `"First argument to createDraft should be a plain object, an array, or an immerable object."`; | ||
|
||
exports[`manual - proxy should check arguments 3`] = `"First argument to finishDraft should be an object from createDraft."`; | ||
|
||
exports[`manual - proxy should support patches drafts 1`] = ` | ||
Array [ | ||
Array [ | ||
Array [ | ||
Object { | ||
"op": "replace", | ||
"path": Array [ | ||
"a", | ||
], | ||
"value": 2, | ||
}, | ||
Object { | ||
"op": "add", | ||
"path": Array [ | ||
"b", | ||
], | ||
"value": 3, | ||
}, | ||
], | ||
Array [ | ||
Object { | ||
"op": "replace", | ||
"path": Array [ | ||
"a", | ||
], | ||
"value": 1, | ||
}, | ||
Object { | ||
"op": "remove", | ||
"path": Array [ | ||
"b", | ||
], | ||
}, | ||
], | ||
], | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters