smartlog-source-ora/test/test.ts

24 lines
745 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;
tap.test('should create an ora instance', async (tools) => {
smartOra = new smartlogSourceOra.SmartlogSourceOra();
expect(smartOra).to.be.instanceOf(smartlogSourceOra.SmartlogSourceOra);
});
tap.test('should start', async (tools) => {
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();