Just use an anonymous function to create your object inside, so you can pass it to expects . Sinona still was not.
expect(-> new Animal()).to.throw(/message/)
Beware that the regex in chai throw always passes if you throw a simple string. It only works correctly if you select the Error object. In any case, it is always better to throw real mistakes.
class Animal constructor: -> throw new Error('message')
Hope this helps.
source share