My assertion is:
it.only('should throw an error if the transcription cannot happen', () => {
expect(TranscriptLib.myFunc({ data }, '1')).to.throw(Error)
})
My function is:
myFunc: (data, id) => {
throw new Error({
message: 'Transcription failed',
error: someError
})
However, when I run my test, the log shows:
Error: [object Object]
and the test fails. What am I doing wrong?