-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vest): use key prop to retain test state after reorder (#732)
- Loading branch information
Showing
30 changed files
with
605 additions
and
67 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
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
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,6 @@ | ||
import { isNull } from 'isNull'; | ||
import { isUndefined } from 'isUndefined'; | ||
|
||
export default function isNullish(value: any): value is null | undefined { | ||
return isNull(value) || isUndefined(value); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import VestTest from 'VestTest'; | ||
|
||
export enum IsolateTypes { | ||
DEFAULT, | ||
SUITE, | ||
EACH, | ||
SKIP_WHEN, | ||
GROUP, | ||
} | ||
|
||
export type IsolateKeys = { | ||
current: Record<string, VestTest>; | ||
prev: Record<string, VestTest>; | ||
}; |
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
47 changes: 47 additions & 0 deletions
47
packages/vest/src/core/test/__tests__/__snapshots__/test.test.ts.snap
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,47 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Test Vest's \`test\` function test params creates a test with a message and with a key 1`] = ` | ||
VestTest { | ||
"fieldName": "field_name", | ||
"id": "21", | ||
"key": "keyboardcat", | ||
"message": "failure message", | ||
"severity": "error", | ||
"status": "PASSING", | ||
"testFn": [Function], | ||
} | ||
`; | ||
|
||
exports[`Test Vest's \`test\` function test params creates a test without a key 1`] = ` | ||
VestTest { | ||
"fieldName": "field_name", | ||
"id": "17", | ||
"key": null, | ||
"message": "failure message", | ||
"severity": "error", | ||
"status": "PASSING", | ||
"testFn": [Function], | ||
} | ||
`; | ||
|
||
exports[`Test Vest's \`test\` function test params creates a test without a message and with a key 1`] = ` | ||
VestTest { | ||
"fieldName": "field_name", | ||
"id": "19", | ||
"key": "keyboardcat", | ||
"severity": "error", | ||
"status": "PASSING", | ||
"testFn": [Function], | ||
} | ||
`; | ||
|
||
exports[`Test Vest's \`test\` function test params creates a test without a message and without a key 1`] = ` | ||
VestTest { | ||
"fieldName": "field_name", | ||
"id": "15", | ||
"key": null, | ||
"severity": "error", | ||
"status": "PASSING", | ||
"testFn": [Function], | ||
} | ||
`; |
Oops, something went wrong.