BREAKING CHANGE(core): switched to ES syntax and added support for interactivity

This commit is contained in:
2023-06-22 11:51:44 +02:00
parent 730a4a05a4
commit e4e08910c7
13 changed files with 4587 additions and 26822 deletions

View File

@ -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;
});