0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/simple/test-child-process-env.js
2010-03-17 14:00:17 -07:00

18 lines
377 B
JavaScript

require("../common");
var spawn = require('child_process').spawn;
child = spawn('/usr/bin/env', [], {'HELLO' : 'WORLD'});
response = "";
child.stdout.setEncoding('utf8');
child.stdout.addListener("data", function (chunk) {
puts("stdout: " + chunk);
response += chunk;
});
process.addListener('exit', function () {
assert.ok(response.indexOf('HELLO=WORLD') >= 0);
});