smarttime/test/test.timer.ts

19 lines
415 B
TypeScript
Raw Permalink Normal View History

2018-03-11 15:44:32 +00:00
// tslint:disable-next-line:no-implicit-dependencies
import { expect, tap } from '@pushrocks/tapbundle';
2018-03-11 15:44:32 +00:00
import { Timer } from '../ts/index';
let testTimer: Timer;
tap.test('should create a valid timer', async () => {
testTimer = new Timer(1000);
2018-06-10 12:00:18 +00:00
expect(testTimer).to.be.instanceof(Timer);
});
2018-03-11 15:44:32 +00:00
tap.test('should start timer', async () => {
2018-06-10 12:00:18 +00:00
testTimer.start();
2018-03-11 15:44:32 +00:00
await testTimer.completed;
2018-06-10 12:00:18 +00:00
});
2018-03-11 15:44:32 +00:00
2018-06-10 12:00:18 +00:00
tap.start();