Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize thrown errors for chai 3.0.0+ #126

Closed
wants to merge 1 commit into from
Closed

Recognize thrown errors for chai 3.0.0+ #126

wants to merge 1 commit into from

Conversation

aurimasv
Copy link

As of v3.0.0 chai utils.type() returns "error" for Error objects.

Edit: the reason this is annoying is because this makes the error message matching different for assert.throws vs assert.isRejected. Since chai-as-promised doesn't recognize Error objects as such, it uses .toString(), which prefixes "Error: " to the message.

As of v3.0.0 (https://github.com/chaijs/chai/releases/tag/3.0.0) chai utils.type() returns "error" for Error objects
@domenic
Copy link
Collaborator

domenic commented Oct 16, 2015

Sorry for the delay on this. Can you write a test showing the problem, that fails before your change and succeeds after?

@domenic
Copy link
Collaborator

domenic commented Dec 20, 2015

Closing since no test.

@domenic domenic closed this Dec 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants