Skip to content

assert: throw when block is not a function

Rodrigo Muino Tomonari requested to merge github/fork/cjihrig/throws into v1.x

Currently, anything passed as the block argument to throws() and doesNotThrow() is interpreted as a function, which can lead to unexpected results. This commit checks the type of block, and throws a TypeError if it is not a function.

We might want to hold off until after 1.0.0, not sure. Closes #275 (closed).

R=@bnoordhuis

Merge request reports

Loading