Skip to content

Commit d419819

Browse files
committed
remove windows specific reposne in stdout
1 parent 8ceef77 commit d419819

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/isolate-test.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function generateTopic(args, file) {
1010
' ./test/fixtures/isolate/' + file,
1111
options = {cwd: path.resolve(__dirname + '/../')},
1212
callback = this.callback;
13+
1314
exec(cmd, options, function (err, stdout, stderr) {
1415
callback(null, {
1516
err: err,
@@ -29,7 +30,14 @@ function assertExecNotOk(r) {
2930
}
3031

3132
function parseResults(stdout) {
32-
return stdout.split(/\n/g).map(function (s) {
33+
var results = stdout.split('\n');
34+
35+
// win32 returns cmd. need to filter out
36+
if(process.platform === 'win32') {
37+
results.shift();
38+
}
39+
40+
return results.map(function (s) {
3341
if (!s) return;
3442
return JSON.parse(s);
3543
}).filter(function (s) {return s});
@@ -63,7 +71,7 @@ vows.describe('vows/isolate').addBatch({
6371
topic: generateTopic('--json', 'passing.js'),
6472
'should be ok': assertExecOk,
6573
'should have correct output': function (r) {
66-
var results = parseResults(r.stdout)
74+
var results = parseResults(r.stdout)
6775

6876
assertResultTypePresent(results, 'subject');
6977
assertResultTypePresent(results, 'end');
@@ -98,7 +106,7 @@ vows.describe('vows/isolate').addBatch({
98106
['oh no!', 'oh no!', 'oh no!', 'oh no!', ''].join(os.EOL));
99107
},
100108
'should have correct output': function (r) {
101-
var results= parseResults(r.stdout);
109+
var results= parseResults(r.stdout);
102110

103111
assertResultsFinish(results, {
104112
total: 4,
@@ -126,7 +134,7 @@ vows.describe('vows/isolate').addBatch({
126134
topic: generateTopic('--json', '*'),
127135
'should be not ok': assertExecNotOk,
128136
'should have correct output': function (r) {
129-
var results= parseResults(r.stdout);
137+
var results= parseResults(r.stdout);
130138

131139
assertResultsFinish(results, {
132140
total: 16,

0 commit comments

Comments
 (0)