Skip to content

Prevent specifying error type in t.notThrows() #178

Open
@sindresorhus

Description

@sindresorhus

Issuehunt badges

It's an easy mistake to make if you have many t.throws() statements and then some t.notThrows() statements.

For example: sindresorhus/p-queue@80e8e25

// Fail
t.notThrows(() => {
 t.pass();
}, TypeError);

// Ok
t.notThrows(() => {
 t.pass();
});

It should fail if it's a variable matching this regex: /^(?:[A-Z][a-z0-9]*)*Error$/


IssueHunt Summary

Backers (Total: $60.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions