Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Nov 4, 2020. It is now read-only.

Fix throws TypeError when passing an arrow function #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
Loading
from

Conversation

wmzy
Copy link

@wmzy wmzy commented Sep 30, 2019

Codes like this:

    should.throws(
      () => {
        throw new Error();
      },
      () => true
    );

won't work:

TypeError: Function has non-object prototype 'undefined' in instanceof check

@btd
Copy link
Member

btd commented Oct 5, 2019

should.throws follow assert.throws behavior only. Your use case is not supported by assert.throws as i see.

@wmzy
Copy link
Author

wmzy commented Oct 8, 2019

assert.throws support this.
See the "Custom error validation" example.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.