shell: add options to exec
This commit is contained in:
@@ -53,24 +53,24 @@ describe('shell', function () {
|
||||
});
|
||||
|
||||
it('execSync a valid shell program', function (done) {
|
||||
shell.exec('test', 'ls -l | wc -c', function (error) {
|
||||
shell.exec('test', 'ls -l | wc -c', {}, function (error) {
|
||||
done(error);
|
||||
});
|
||||
});
|
||||
|
||||
it('execSync a valid shell program (promises)', async function () {
|
||||
await shell.promises.exec('test', 'ls -l | wc -c');
|
||||
await shell.promises.exec('test', 'ls -l | wc -c', {});
|
||||
});
|
||||
|
||||
it('execSync throws for invalid program', function (done) {
|
||||
shell.exec('test', 'cannotexist', function (error) {
|
||||
shell.exec('test', 'cannotexist', {}, function (error) {
|
||||
expect(error).to.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('execSync throws for failed program', function (done) {
|
||||
shell.exec('test', 'false', function (error) {
|
||||
shell.exec('test', 'false', {}, function (error) {
|
||||
expect(error).to.be.ok();
|
||||
done();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user