smartdebug/test/test.ts

25 lines
802 B
TypeScript
Raw Normal View History

2018-04-12 17:29:24 +00:00
// tslint:disable-next-line:no-implicit-dependencies
2018-04-12 16:02:48 +00:00
import { expect, tap } from 'tapbundle';
import * as smartdebug from '../ts/index';
2017-09-18 13:19:18 +00:00
2018-04-12 16:02:48 +00:00
let testSmartDebug: smartdebug.SmartDebug;
2017-09-18 13:19:18 +00:00
tap.test('should create a valid instance of SmartDebug', async () => {
2018-04-12 16:02:48 +00:00
testSmartDebug = new smartdebug.SmartDebug();
});
2017-09-18 13:19:18 +00:00
tap.test('should not log a message, if debugEnabled = false', async () => {
2018-04-12 16:02:48 +00:00
testSmartDebug.log('should not log to console');
// tslint:disable-next-line:no-unused-expression
expect(testSmartDebug.debugEnabled).to.be.false;
});
2017-09-18 13:19:18 +00:00
tap.test('should log to console, if enabled', async () => {
2018-04-12 16:02:48 +00:00
testSmartDebug.enableDebugging();
testSmartDebug.log('should log to console');
// tslint:disable-next-line:no-unused-expression
expect(testSmartDebug.debugEnabled).to.be.true;
});
2017-09-18 13:19:18 +00:00
2018-04-12 16:02:48 +00:00
tap.start();