function error(e) { throw e; } error = sinon.spy(error); tryCatch(error, null, new Error('Exception was thrown')); expect(error) .to.have.been.calledOnce .and .have.been.calledWithMatch({ message: 'Exception was thrown', name: 'Error' }) .and .have.thrown();