-
-
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.
- Loading branch information
Showing
10 changed files
with
521 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ export enum IsolateTypes { | |
SUITE, | ||
EACH, | ||
SKIP_WHEN, | ||
OMIT_WHEN, | ||
GROUP, | ||
} | ||
|
||
|
315 changes: 315 additions & 0 deletions
315
packages/vest/src/core/isolate/isolates/__tests__/__snapshots__/omitWhen.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,315 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`omitWhen When conditional is falsy boolean conditional Should have all tests within the omit block referenced in the result 1`] = ` | ||
Object { | ||
"field_1": Object { | ||
"errorCount": 1, | ||
"testCount": 2, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is falsy boolean conditional Should run tests normally 1`] = ` | ||
Object { | ||
"field_1": Object { | ||
"errorCount": 1, | ||
"testCount": 2, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is falsy boolean conditional Should run tests normally 2`] = ` | ||
Object { | ||
"field_1": Object { | ||
"errorCount": 1, | ||
"testCount": 2, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is falsy function conditional Should have all tests within the omit block referenced in the result 1`] = ` | ||
Object { | ||
"field_1": Object { | ||
"errorCount": 1, | ||
"testCount": 2, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is falsy function conditional Should run tests normally 1`] = ` | ||
Object { | ||
"field_1": Object { | ||
"errorCount": 1, | ||
"testCount": 2, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is falsy function conditional Should run tests normally 2`] = ` | ||
Object { | ||
"field_1": Object { | ||
"errorCount": 1, | ||
"testCount": 2, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is truthy boolean conditional Should avoid running the omitted tests 1`] = ` | ||
Object { | ||
"errorCount": 1, | ||
"getErrors": [Function], | ||
"getErrorsByGroup": [Function], | ||
"getWarnings": [Function], | ||
"getWarningsByGroup": [Function], | ||
"groups": Object {}, | ||
"hasErrors": [Function], | ||
"hasErrorsByGroup": [Function], | ||
"hasWarnings": [Function], | ||
"hasWarningsByGroup": [Function], | ||
"isValid": [Function], | ||
"suiteName": undefined, | ||
"testCount": 2, | ||
"tests": Object { | ||
"field_1": Object { | ||
"errorCount": 0, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 1, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
}, | ||
"warnCount": 0, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is truthy boolean conditional Should skip and not run omitted fields when no filter provided 1`] = ` | ||
Object { | ||
"errorCount": 1, | ||
"getErrors": [Function], | ||
"getErrorsByGroup": [Function], | ||
"getWarnings": [Function], | ||
"getWarningsByGroup": [Function], | ||
"groups": Object {}, | ||
"hasErrors": [Function], | ||
"hasErrorsByGroup": [Function], | ||
"hasWarnings": [Function], | ||
"hasWarningsByGroup": [Function], | ||
"isValid": [Function], | ||
"suiteName": undefined, | ||
"testCount": 2, | ||
"tests": Object { | ||
"field_1": Object { | ||
"errorCount": 0, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 1, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
}, | ||
"warnCount": 0, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is truthy function conditional Should avoid running the omitted tests 1`] = ` | ||
Object { | ||
"errorCount": 1, | ||
"getErrors": [Function], | ||
"getErrorsByGroup": [Function], | ||
"getWarnings": [Function], | ||
"getWarningsByGroup": [Function], | ||
"groups": Object {}, | ||
"hasErrors": [Function], | ||
"hasErrorsByGroup": [Function], | ||
"hasWarnings": [Function], | ||
"hasWarningsByGroup": [Function], | ||
"isValid": [Function], | ||
"suiteName": undefined, | ||
"testCount": 2, | ||
"tests": Object { | ||
"field_1": Object { | ||
"errorCount": 0, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 1, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
}, | ||
"warnCount": 0, | ||
} | ||
`; | ||
|
||
exports[`omitWhen When conditional is truthy function conditional Should skip and not run omitted fields when no filter provided 1`] = ` | ||
Object { | ||
"errorCount": 1, | ||
"getErrors": [Function], | ||
"getErrorsByGroup": [Function], | ||
"getWarnings": [Function], | ||
"getWarningsByGroup": [Function], | ||
"groups": Object {}, | ||
"hasErrors": [Function], | ||
"hasErrorsByGroup": [Function], | ||
"hasWarnings": [Function], | ||
"hasWarningsByGroup": [Function], | ||
"isValid": [Function], | ||
"suiteName": undefined, | ||
"testCount": 2, | ||
"tests": Object { | ||
"field_1": Object { | ||
"errorCount": 0, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
"field_2": Object { | ||
"errorCount": 1, | ||
"testCount": 1, | ||
"warnCount": 0, | ||
}, | ||
"field_3": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
"field_4": Object { | ||
"errorCount": 0, | ||
"testCount": 0, | ||
"warnCount": 0, | ||
}, | ||
}, | ||
"warnCount": 0, | ||
} | ||
`; |
Oops, something went wrong.