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