add smart sourcing of files with bash

This commit is contained in:
2017-03-10 22:08:04 +01:00
parent a91938e463
commit 2d3a4b0a0e
8 changed files with 100 additions and 15 deletions

View File

@ -3,6 +3,8 @@ import { expect } from 'smartchai'
import * as smartshell from '../dist/index'
let testSmartshell: smartshell.Smartshell
describe('smartshell', function () {
it('it should run async', function () {
this.timeout(1000000)
@ -10,16 +12,23 @@ describe('smartshell', function () {
expect(execResult.stdout).to.match(/[0-9\.]*/)
})
})
it('should run async and silent', function() {
it('should run async and silent', function () {
return smartshell.execSilent('npm -v').then((execResult) => {
expect(execResult.stdout).to.match(/[0-9\.]*/)
})
})
it('should stream a shell execution', function() {
it('should stream a shell execution', function () {
let execStreamingResponse = smartshell.execStreaming('npm -v')
execStreamingResponse.childProcess.stdout.on('data', (data) => {
console.log('Received ' + data)
})
return execStreamingResponse.finalPromise
})
it('should create a Smartshell instance', function () {
testSmartshell = new smartshell.Smartshell({
executor: 'bash',
sourceFilePaths: []
})
expect(testSmartshell).to.be.instanceof(smartshell.Smartshell)
})
})