Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acf3aa3
commit cd8518b
Showing
10 changed files
with
110 additions
and
75 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ node_modules | |
*.log | ||
lib | ||
dist | ||
test-lib | ||
test-lib/**/*.js | ||
coverage | ||
.nyc_output | ||
.idea |
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
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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`it should fail if not optional and no default provided 1`] = ` | ||
"[mobx-state-tree] Error while converting \`undefined\` to \`\\"hello\\"\`: | ||
value \`undefined\` is not assignable to type: \`\\"hello\\"\` (Value is not a literal \\"hello\\"), expected an instance of \`\\"hello\\"\` or a snapshot like \`\\"hello\\"\` instead." | ||
`; | ||
|
||
exports[`it should throw if a different type is given 1`] = ` | ||
"[mobx-state-tree] Error while converting \`{\\"shouldBeOne\\":2}\` to \`TestFactory\`: | ||
at path \\"/shouldBeOne\\" value \`2\` is not assignable to type: \`1\` (Value is not a literal 1), expected an instance of \`1\` or a snapshot like \`1\` instead." | ||
`; |
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,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`References are non-nullable by default 1`] = `"[mobx-state-tree] Failed to resolve reference of type AnonymousModel: '4' (in: /ref)"`; | ||
|
||
exports[`References are non-nullable by default 2`] = `"[mobx-state-tree] Failed to resolve reference of type AnonymousModel: '4' (in: /maybeRef)"`; | ||
|
||
exports[`References are non-nullable by default 3`] = ` | ||
"[mobx-state-tree] Error while converting \`null\` to \`reference(AnonymousModel)\`: | ||
value \`null\` is not assignable to type: \`reference(AnonymousModel)\` (Value is not a valid identifier, which is a string or a number), expected an instance of \`reference(AnonymousModel)\` or a snapshot like \`reference(AnonymousModel)\` instead." | ||
`; |
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,14 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`it should complain about multiple applicable types no dispatch method 1`] = ` | ||
"[mobx-state-tree] Error while converting \`{\\"width\\":2,\\"height\\":2}\` to \`Box | Square\`: | ||
snapshot \`{\\"width\\":2,\\"height\\":2}\` is not assignable to type: \`Box | Square\` (Multiple types are applicable for the union (hint: provide a dispatch function)), expected an instance of \`Box | Square\` or a snapshot like \`({ width: number; height: number } | { width: number })\` instead." | ||
`; | ||
|
||
exports[`it should complain about no applicable types 1`] = ` | ||
"[mobx-state-tree] Error while converting \`{\\"height\\":2}\` to \`Cube | Box\`: | ||
snapshot \`{\\"height\\":2}\` is not assignable to type: \`Cube | Box\` (No type is applicable for the union), expected an instance of \`Cube | Box\` or a snapshot like \`({ width: number; height: number; depth: number } | { width: number; height: number })\` instead. | ||
at path \\"/width\\" value \`undefined\` is not assignable to type: \`number\` (Value is not a number). | ||
at path \\"/depth\\" value \`undefined\` is not assignable to type: \`number\` (Value is not a number). | ||
at path \\"/width\\" value \`undefined\` is not assignable to type: \`number\` (Value is not a number)." | ||
`; |
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
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
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
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
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