Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.73.x] Hotfix release 0.73.9 - sync watcher backends with 0.76.0 #949

Merged
merged 8 commits into from
Mar 21, 2023
27 changes: 27 additions & 0 deletions packages/metro-file-map/src/watchers/__tests__/integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,33 @@ describe.each(Object.keys(WATCHERS))(
});
});

maybeTest('detects changes to files in a new directory', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you're planning to add this test on main? Or do we have equivalent coverage there by now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep - diff incoming.

expect(
await eventHelpers.nextEvent(() => mkdir(join(watchRoot, 'newdir'))),
).toStrictEqual({
path: join('newdir'),
eventType: 'add',
metadata: {
modifiedTime: expect.any(Number),
size: expect.any(Number),
type: 'd',
},
});
expect(
await eventHelpers.nextEvent(() =>
writeFile(join(watchRoot, 'newdir', 'file-in-new-dir.js'), 'code'),
),
).toStrictEqual({
path: join('newdir', 'file-in-new-dir.js'),
eventType: 'add',
metadata: {
modifiedTime: expect.any(Number),
size: expect.any(Number),
type: 'f',
},
});
});

maybeTest(
'emits deletion for all files when a directory is deleted',
async () => {
Expand Down