-
Notifications
You must be signed in to change notification settings - Fork 941
Description
Describe the bug
1.0.0-beta.2 introduces breaking changes to the function version of .when as outlined in #1542 . PR says change is breaking for function version, but changes are also breaking for the object version when then or otherwise are SchemaLikes instead of functions
To Reproduce
This test case fails on 1.0.0-beta.2 but works on 0.27.0
https://codesandbox.io/s/naughty-hermann-r0b2l?file=/src/index.test.js
Expected behavior
Either both test cases should work, or the docs should be updated. Currently the docs are unclear on the object version types, though the examples have been updated to use function for both then and otherwise However, this line: You can provide an object literal where the key is is value or a matcher function, then provides the true schema and/or otherwise for the failure condition. still implies that then can be a schema.
Platform (please complete the following information):
Version 1.0.0-beta.2