Skip to content

Commit

Permalink
test: sort babel-cli log
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed May 6, 2022
1 parent 0984a2a commit 7d81952
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -16,10 +16,11 @@ const run = (async function* () {
await new Promise(resolve => setTimeout(resolve, 2000));
fs.writeFileSync("./file.txt", "Updated!");

files = [yield, yield].sort();
assert.match(files[0], /src[\\/]index.js -> lib[\\/]index.js/);
assert.match(files[1], /src[\\/]main.js -> lib[\\/]main.js/);
assert.match(yield, /Successfully compiled 2 files with Babel \(\d+ms\)\./);
// This test is flaky, "Successfully compiled 2 files" sometimes print before `src/main.js`
let logs = [yield, yield, yield].sort();
assert.match(logs[0], /Successfully compiled 2 files with Babel \(\d+ms\)\./);
assert.match(logs[1], /src[\\/]index.js -> lib[\\/]index.js/);
assert.match(logs[2], /src[\\/]main.js -> lib[\\/]main.js/);

logFile("lib/index.js");
logFile("lib/main.js");
Expand Down

0 comments on commit 7d81952

Please sign in to comment.