From deb7859bb01831b68615c5e5416174eb4b4e0d58 Mon Sep 17 00:00:00 2001 From: mofeiZ <34200447+mofeiZ@users.noreply.github.com> Date: Fri, 28 Mar 2025 16:03:08 -0400 Subject: [PATCH] [compiler][snap] Fix test filter + watch mode (#32780) Accidentally broke this when migrating our test runner to use the bundled build https://github.com/facebook/react/pull/32758 The fix is pretty simple. File watcher should listen for changes in `packages/babel-plugin-react-compiler` instead of `cwd`, which is now `packages/snap`. --- compiler/packages/snap/src/runner-watch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/packages/snap/src/runner-watch.ts b/compiler/packages/snap/src/runner-watch.ts index e6632d83ed..6073fd30f9 100644 --- a/compiler/packages/snap/src/runner-watch.ts +++ b/compiler/packages/snap/src/runner-watch.ts @@ -146,7 +146,7 @@ function subscribeFilterFile( state: RunnerState, onChange: (state: RunnerState) => void, ) { - watcher.subscribe(process.cwd(), async (err, events) => { + watcher.subscribe(PROJECT_ROOT, async (err, events) => { if (err) { console.error(err); process.exit(1);