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.

20 lines
542 B

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