bootstrap Smartshell class
This commit is contained in:
26
test/test.ts
26
test/test.ts
@ -3,11 +3,23 @@ import { expect } from 'smartchai'
|
||||
|
||||
import * as smartshell from '../dist/index'
|
||||
|
||||
describe('smartshell', function() {
|
||||
it('it should run async', function() {
|
||||
this.timeout(1000000)
|
||||
return smartshell.exec('npmdocker speedtest').then((execResult) => {
|
||||
console.log(execResult.stdout)
|
||||
})
|
||||
describe('smartshell', function () {
|
||||
it('it should run async', function () {
|
||||
this.timeout(1000000)
|
||||
return smartshell.exec('npm -v').then((execResult) => {
|
||||
expect(execResult.stdout).to.match(/[0-9\.]*/)
|
||||
})
|
||||
})
|
||||
})
|
||||
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() {
|
||||
let execStreamingResponse = smartshell.execStreaming('npm -v')
|
||||
execStreamingResponse.childProcess.stdout.on('data', (data) => {
|
||||
console.log('Received ' + data)
|
||||
})
|
||||
return execStreamingResponse.finalPromise
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user