Skip to content

How to fail() a test? #292

Open
Open

Description

@ibc

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?

Activity

  1. StuartHa commented on Mar 4, 2015

    @StuartHa

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

  2. mreinstein commented on Mar 4, 2015

    @mreinstein
    Collaborator

    pull request welcome!

  3. shakeelmohamed commented on May 6, 2015

    @shakeelmohamed

    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

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