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

How to fail() a test? #292

Open
ibc opened this issue Feb 18, 2015 · 3 comments
Open

How to fail() a test? #292

ibc opened this issue Feb 18, 2015 · 3 comments

Comments

@ibc
Copy link

ibc commented Feb 18, 2015

I hate myself when I want to end a test and the only solution coming to my mind is:

foo(err) {
  if (err) {
    test.ok(false, 'error in foo, test finished');
    test.done();
  }
}

Would be useful some kind of test.fail(error) method? do I miss something?

@StuartHa
Copy link

StuartHa commented Mar 4, 2015

+1 I am using this pattern too and it's not great.

@mreinstein
Copy link
Collaborator

pull request welcome!

@shakeelmohamed
Copy link

This would basically be a hybrid of test.ok() and test.done(), right?

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

4 participants