Skip to content

Commit

Permalink
refactor: use promise.all
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Dec 26, 2021
1 parent 465b77b commit cbd1e9e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/watch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1325,9 +1325,9 @@ describe('rollup.watch', () => {
const transformFile = resolve('test/_tmp/input/transform');
const watchFiles = [buildStartFile, loadFile, resolveIdFile, transformFile];
await copy('test/watch/samples/basic', 'test/_tmp/input');
for (const file of watchFiles) {
await promises.writeFile(file, 'initial');
}

await Promise.all(watchFiles.map(file => promises.writeFile(file, 'initial')));

watcher = rollup.watch({
input: 'test/_tmp/input/main.js',
output: {
Expand Down Expand Up @@ -1362,9 +1362,8 @@ describe('rollup.watch', () => {
assert.strictEqual(run('../_tmp/output/bundle.js'), 42);
// sometimes the watcher is triggered during the initial run
watchChangeIds.clear();
for (const file_2 of watchFiles) {
await promises.writeFile(file_2, 'changed');
}

await Promise.all(watchFiles.map(file_2 => promises.writeFile(file_2, 'changed')));
},
'START',
'BUNDLE_START',
Expand Down

0 comments on commit cbd1e9e

Please sign in to comment.