Skip to content

Instantly share code, notes, and snippets.

Unit Test:
describe('check unhandled exceptions', () => {
it ('should log error and exit if unhandled exception is caught', ()=> {
let options = {
log: console.log,
err: console.error };
let errSpy = sinon.spy(options, 'err');
let expOut = "Server has crashed with Error: We Crashed!";
app.crash();