Skip to content

Commit 59e0a49

Browse files
test: wait for a watched managed file's own change event (#22831)
A managed package's index.js and package.json can be reported in separate batches on macOS; the build seeing only index.js reads the cached old version and keeps the old module, so the harness must wait for package.json too.
1 parent 240a0b2 commit 59e0a49

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎test/templates/WatchTestCases.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,9 @@ const describeCases = (config) => {
701701
: [watchedCompiler];
702702
for (const child of children) {
703703
for (const file of unseenChanges) {
704-
// even a managed path reports a directory appearing
705-
if (lastMissingDependencies.has(file)) continue;
704+
// even a managed path reports a directory appearing, and a watched file
705+
// itself: a build seeing `index.js` before `package.json` reads the old version
706+
if (lastFileDependencies.has(file)) continue;
706707
for (const item of [
707708
...child.managedPaths,
708709
...child.immutablePaths

0 commit comments

Comments
 (0)