diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch multiple dir/executor.js b/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch multiple dir/executor.js index ddd810e3aa90..1d480afb2637 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch multiple dir/executor.js +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch multiple dir/executor.js @@ -4,9 +4,11 @@ const assert = require("assert"); // For Node.js <= 10 if (!assert.match) assert.match = (val, re) => assert(re.test(val)); -const run = (function* () { +const run = (async function* () { assert.match(yield, /Successfully compiled 4 files with Babel \(\d+ms\)\./); + // wait 200ms for watcher setup + await new Promise(resolve => setTimeout(resolve, 200)); // update ./module1/src/index.js fs.writeFileSync( "./module1/src/index.js", @@ -18,13 +20,13 @@ const run = (function* () { run.next(); -process.stdin.on("data", function listener(chunk) { +process.stdin.on("data", async function listener(chunk) { const str = String(chunk).trim(); if (!str) return; console.log(str); - if (run.next(str).done) { + if ((await run.next(str)).done) { process.exit(0); } }); diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch multiple dir/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch multiple dir/options.json index f9b5f5624438..0e04683004f1 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch multiple dir/options.json +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch multiple dir/options.json @@ -2,5 +2,5 @@ "args": ["*/src", "--out-dir", "../lib", "--relative", "--watch"], "noBabelrc": true, "noDefaultPlugins": true, - "minNodeVersion": 8 + "minNodeVersion": 10 }