caolan / caolan/nodeunit

test.throws incorrectly implemented

Open
#156 2 comments 1 reaction 0 assignees View on GitHub
API Breaking Change
Dominant language
JavaScript
Stars
1.9k
Forks
359
PR merge metrics
No merged PRs in 30d

Description

According to http://nodejs.org/docs/v0.4.2/api/assert.html#assert.throws
... assert.throws can be passed three arguments:
`assert.throws(block, [error], [message])`

The `error` parameter can be constructor, regexp or validation function. Nodeunit assumes that `error` is a constructor and simply uses instanceof to validate. This behavior is incorrect. Regexp or validation function should be supported.

Contributor guide

No contributing guide indexed for this repository

Research direction

Read the existing assert.throws implementation and its tests, then compare the behavior with the linked Node.js assert.throws documentation. Done means supporting constructor, regular-expression, and validation-function error arguments instead of only instanceof checks, with coverage for each form.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.