From 925b467a4e6f76bee6252d5bc7b90ca579c77bf3 Mon Sep 17 00:00:00 2001 From: Igor Zinkovsky Date: Mon, 1 Aug 2011 13:43:38 -0700 Subject: [PATCH] fix test-child-process-env on windows --- test/simple/test-child-process-env.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/simple/test-child-process-env.js b/test/simple/test-child-process-env.js index b8d3a92ae73..7e61b2e6af3 100644 --- a/test/simple/test-child-process-env.js +++ b/test/simple/test-child-process-env.js @@ -24,6 +24,8 @@ var assert = require('assert'); var spawn = require('child_process').spawn; +var isWindows = process.platform === 'win32'; + var env = { 'HELLO': 'WORLD' }; @@ -31,7 +33,12 @@ env.__proto__ = { 'FOO': 'BAR' } -var child = spawn('/usr/bin/env', [], {env: env}); +if (isWindows) { + var child = spawn('cmd.exe', ['/c set'], {env: env}); +} else { + var child = spawn('/usr/bin/env', [], {env: env}); +} + var response = '';