shelljs/test/make.js
Artur Adib e4d9dabe52 introducing config.silent, config.fatal
deprecates silent()
2012-12-01 09:48:23 -05:00

15 lines
540 B
JavaScript

var shell = require('..'),
child = require('child_process'),
assert = require('assert');
shell.mkdir('-p', 'tmp');
var file = 'tmp/tempscript'+Math.random()+'.js',
script = 'require(\'../../make.js\'); target.all=function(){echo("first"); cp("this_file_doesnt_exist", "."); echo("second");}';
script.to(file);
child.exec('node '+file, function(err, stdout, stderr) {
assert.ok(stdout.match('first'));
assert.ok(!stdout.match('second')); // Make should die on errors, so this should never get echoed
shell.exit(123);
});