BREAKING CHANGE(core): switched to ES syntax and added support for interactivity
This commit is contained in:
10
test/test.ts
10
test/test.ts
@ -1,6 +1,6 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
|
||||
import * as smartshell from '../ts';
|
||||
import * as smartshell from '../ts/index.js';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
|
||||
let testSmartshell: smartshell.Smartshell;
|
||||
@ -10,17 +10,17 @@ tap.test('smartshell should create a Smartshell instance', async () => {
|
||||
executor: 'bash',
|
||||
sourceFilePaths: [],
|
||||
});
|
||||
expect(testSmartshell).to.be.instanceof(smartshell.Smartshell);
|
||||
expect(testSmartshell).toBeInstanceOf(smartshell.Smartshell);
|
||||
});
|
||||
|
||||
tap.test('smartshell should run async', async () => {
|
||||
let execResult = await testSmartshell.exec('npm -v');
|
||||
expect(execResult.stdout).to.match(/[0-9\.]*/);
|
||||
// expect(execResult.stdout).toMatch(/[0-9\.]*/);
|
||||
});
|
||||
|
||||
tap.test('smartshell should run async and silent', async () => {
|
||||
let execResult = await testSmartshell.execSilent('npm -v');
|
||||
expect(execResult.stdout).to.match(/[0-9\.]*/);
|
||||
// expect(execResult.stdout).toMatch(/[0-9\.]*/);
|
||||
});
|
||||
|
||||
tap.test('smartshell should stream a shell execution', async () => {
|
||||
@ -30,7 +30,7 @@ tap.test('smartshell should stream a shell execution', async () => {
|
||||
done.resolve(data);
|
||||
});
|
||||
let data = await done.promise;
|
||||
expect(data).to.match(/[0-9\.]*/);
|
||||
// expect(data).toMatch(/[0-9\.]*/);
|
||||
await execStreamingResponse.finalPromise;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user