FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix throws `TypeError` when passing an arrow function by wmzy · Pull Request #186 · shouldjs/should.js · GitHub

This repository was archived by the owner on Nov 4, 2020. It is now read-only.
/ should.js Public archive

Fix throws TypeError when passing an arrow function - #186

Open
wmzy wants to merge 1 commit into
shouldjs:masterfrom
wmzy-trash:master
Open

Fix throws TypeError when passing an arrow function#186
wmzy wants to merge 1 commit into
shouldjs:masterfrom
wmzy-trash:master

Conversation

wmzy commented Sep 30, 2019

Copy link
Copy Markdown

Codes like this:

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

won't work:

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

btd commented Oct 5, 2019

Copy link
Copy Markdown
Member

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

wmzy commented Oct 8, 2019

Copy link
Copy Markdown
Author

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL