smartlog-source-ora/test/test.ts

24 lines
741 B
TypeScript
Raw Normal View History

2019-05-09 17:17:03 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartlogSourceOra from '../ts/index';
let smartOra: smartlogSourceOra.SmartlogSourceOra;
2019-05-09 17:19:49 +00:00
tap.test('should create an ora instance', async tools => {
2019-05-09 17:17:03 +00:00
smartOra = new smartlogSourceOra.SmartlogSourceOra();
expect(smartOra).to.be.instanceOf(smartlogSourceOra.SmartlogSourceOra);
});
2019-05-09 17:19:49 +00:00
tap.test('should start', async tools => {
2019-05-09 17:17:03 +00:00
smartOra.text('getting started...');
await tools.delayFor(2000);
smartOra.finishSuccess();
smartOra.text('this should show');
await tools.delayFor(2000);
smartOra.successAndNext('and this also');
smartOra.text('this should replace the current text');
await tools.delayFor(1000);
smartOra.finishSuccess('finish!');
});
tap.start();