Skip to content

Commit

Permalink
Merge pull request #626 from w3c/headless_stdout
Browse files Browse the repository at this point in the history
Fix (headless.js): pipe child stdout and stderr to parent
  • Loading branch information
Marcos Caceres committed Mar 9, 2016
2 parents 7f2fdf2 + 1d00f09 commit e67edb8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/headless.js
Expand Up @@ -4,6 +4,7 @@
"use strict";
const fs = require("fs");
const async = require("marcosc-async");
const builder = require("../tools/build-w3c-common");
const colors = require("colors");
const exec = require("child_process").exec;
const express = require("express");
Expand All @@ -27,12 +28,14 @@ function toExecutable(cmd) {
},
run() {
return new Promise((resolve, reject) => {
exec(cmd, (err, data) => {
const childProcess = exec(cmd, (err, data) => {
if (err) {
return reject(err);
}
resolve(data);
});
childProcess.stdout.pipe(process.stdout);
childProcess.stderr.pipe(process.stderr);
});
}
};
Expand Down Expand Up @@ -88,6 +91,8 @@ async.task(function*() {
const dir = require("path").join(__dirname, "..");
app.use(express.static(dir));
app.listen(port);
debug(" ⏲ Building ReSpec...");
yield builder.buildW3C("latest");
debug(" ⏲ Running ReSpec2html tests...");
yield runRespec2html(server);
})
Expand Down

0 comments on commit e67edb8

Please sign in to comment.