Assert an error is thrown using the new to execute a constructor function

Viewed 2111

Using Chai with Mocha, what syntax would I use to assert that an error is thrown when using the new keyword to execute a constructor function? I get an error when I use the following:

assert.throw(new SomeFunction, Error);

This returns:

AssertionError: expected { Object () } to be a function

1 Answers
Related