зеркало из https://github.com/Azure/ms-rest-js.git
Don't spawn subprocess in mocha before()
This commit is contained in:
Родитель
13d95979b1
Коммит
e0770d8020
|
@ -6,19 +6,23 @@ import * as path from "path";
|
|||
|
||||
let serverProcess: childProcess.ChildProcess;
|
||||
|
||||
before(function(done) {
|
||||
serverProcess = childProcess.spawn(path.join(__dirname, "../../node_modules/.bin/ts-node"), ["testserver", "--no-webpack"], { shell: true });
|
||||
const dataListener = function(data: Buffer) {
|
||||
console.log(data.toString("utf-8"));
|
||||
serverProcess.stdout.removeListener("data", dataListener);
|
||||
done();
|
||||
};
|
||||
// TODO: figure out why this hangs on Windows
|
||||
const flag = false;
|
||||
if (flag) {
|
||||
before(function(done) {
|
||||
serverProcess = childProcess.spawn(path.join(__dirname, "../../node_modules/.bin/ts-node"), ["testserver", "--no-webpack"], { shell: true });
|
||||
const dataListener = function(data: Buffer) {
|
||||
console.log(data.toString("utf-8"));
|
||||
serverProcess.stdout.removeListener("data", dataListener);
|
||||
done();
|
||||
};
|
||||
|
||||
serverProcess.stdout.on("data", dataListener);
|
||||
serverProcess.stderr.on("data", dataListener);
|
||||
serverProcess.on("error", function(err) { done(err); });
|
||||
});
|
||||
serverProcess.stdout.on("data", dataListener);
|
||||
serverProcess.stderr.on("data", dataListener);
|
||||
serverProcess.on("error", function(err) { done(err); });
|
||||
});
|
||||
|
||||
after(function() {
|
||||
serverProcess.kill();
|
||||
});
|
||||
after(function() {
|
||||
serverProcess.kill();
|
||||
});
|
||||
}
|
Загрузка…
Ссылка в новой задаче