Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a expect.fail() #200

Open
ulrikstrid opened this issue Sep 19, 2019 · 1 comment
Open

Add a expect.fail() #200

ulrikstrid opened this issue Sep 19, 2019 · 1 comment

Comments

@ulrikstrid
Copy link
Contributor

ulrikstrid commented Sep 19, 2019

This is useful when pattern matching and only 1 of the branches are okay. Currently we have to do some dummy-expect that we can make sure fails. Example where it would be useful:

switch (response.body) {
| `String(body) => expect.string(body).toEqual("test")
| _ => expect.fail() /* currently: expect.string("fail").toEqual("me") */
}
@kyldvs
Copy link
Contributor

kyldvs commented Sep 19, 2019

I would like this too! I would probably make it so that expect.fail() also accepts a string for a description to use in the error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants