Skip to content

1.0 beta includes breaking changes for .when beyond just function version #1579

@evanseeds

Description

@evanseeds

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions