fix<compiler>: only call readTestFilter if the filter option is enabled (#29720)
Following the instructions in the compiler/docs/DEVELOPMENT_GUIDE.md, we are stuck on the command `yarn snap --watch` because it calls readTestFilter even though the filter option is not enabled.
XiaoPi committed
Jun 4, 2024 at 07:09 UTC
408258268edb5acdfdbf77bc6e0b0dc6396c0e6f
1 file changed
+2
-2
compiler/packages/snap/src/runner-watch.ts
+2
-2
@@ -153,8 +153,8 @@ function subscribeFilterFile(
153
} else if (
154
events.findIndex((event) => event.path.includes(FILTER_FILENAME)) !== -1
155
) {
156
- state.filter = await readTestFilter();
156
if (state.mode.filter) {
157
+ state.filter = await readTestFilter();
158
state.mode.action = RunnerAction.Test;
159
onChange(state);
160
}
@@ -218,7 +218,7 @@ export async function makeWatchRunner(
218
action: RunnerAction.Test,
219
filter: filterMode,
220
},
221
- filter: await readTestFilter(),
221
+ filter: filterMode ? await readTestFilter() : null,
222
};
223
224
subscribeTsc(state, onChange);