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 toBeThenable and ToBeCatchy Matcher #3031

Closed
voxsim opened this issue Mar 1, 2017 · 2 comments
Closed

Add toBeThenable and ToBeCatchy Matcher #3031

voxsim opened this issue Mar 1, 2017 · 2 comments

Comments

@voxsim
Copy link

voxsim commented Mar 1, 2017

Do you want to request a feature or report a bug?
A feature.

What is the current behavior?
Yesterday I write something like this:

expr
.then(function() {
  throw new Error('the expression did not fail');
})
.catch((reason) =>
  expect(reason.message).toContain(error),
);

I think could be more idiomatic write something like this:

expr.toBeCatchy((reason) => expect(reason.message).toContain(error));

or you can simply write this, if you expect that it should fail every time:

expr.toBeCatchy();

And we can do the same with toBeThenable. If you like the idea I can work on a PR, let me know ;)

@julien-f
Copy link

julien-f commented Mar 1, 2017

Duplicate of #1377.

@cpojer cpojer closed this as completed Mar 1, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants