You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
542 B
21 lines
542 B
5 years ago
|
|
||
|
var test = require('tap').test;
|
||
|
var execstream = require('./execspawn.js');
|
||
|
var endpoint = require('endpoint');
|
||
|
|
||
|
test('default', function (t) {
|
||
|
execstream('echo "hallo world";').stdout.pipe(endpoint(function (err, out) {
|
||
|
t.equal(err, null);
|
||
|
t.equal(out.toString(), 'hallo world\n');
|
||
|
t.end();
|
||
|
}));
|
||
|
});
|
||
|
|
||
|
test('shell option', function (t) {
|
||
|
execstream('hallo world', { shell: 'echo' }).stdout.pipe(endpoint(function (err, out) {
|
||
|
t.equal(err, null);
|
||
|
t.equal(out.toString(), '-c hallo world\n');
|
||
|
t.end();
|
||
|
}));
|
||
|
});
|