smarterror/test/test.ts

18 lines
545 B
TypeScript
Raw Normal View History

import * as smarterror from '../ts/index';
2017-06-09 12:59:36 +00:00
import { expect, tap } from 'tapbundle';
2017-06-09 13:30:50 +00:00
let originalError: smarterror.SmartError;
2017-06-09 13:30:50 +00:00
tap.test('should create a valid error', async () => {
originalError = new smarterror.SmartError('wow');
expect(originalError).to.be.instanceof(Error);
console.log(originalError.cleanFullStack);
});
tap.test('should accept another error as cause', async () => {
let anotherError = new smarterror.SmartError('this is another Error', originalError);
console.log(anotherError.cleanFullStack);
2017-06-09 13:30:50 +00:00
})
tap.start();