Skip to content

throws doesn't count against assertion count and doesn't require error param #309

@mattkrick

Description

@mattkrick

Here's my actual code:

test('LocalStrategy:Signup:AlreadyExists  ', async t => {
  t.plan(1)
  await signupDB('test@test', '123123');
  t.throws(signupDB('test@test', 'XXXXXX'));
});

As is, it fails unless the first line is t.plan(0) (Assertion count does not match planned). I would assume a throws would count as an assertion, right?

Second, the docs show error is the second required param, but the assertion is successful no matter what value I put in there. I can even leave it undefined (as above) & it still passes.

As a workaround, I'm using a try catch block that works fine, but it'd be nice to condense the code & just use throws.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions