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.
This commit is contained in:
XiaoPi
2024-06-04 07:09:58 +08:00
committed by GitHub
parent 8b677b1e6e
commit 408258268e

View File

@@ -153,8 +153,8 @@ function subscribeFilterFile(
} else if (
events.findIndex((event) => event.path.includes(FILTER_FILENAME)) !== -1
) {
state.filter = await readTestFilter();
if (state.mode.filter) {
state.filter = await readTestFilter();
state.mode.action = RunnerAction.Test;
onChange(state);
}
@@ -218,7 +218,7 @@ export async function makeWatchRunner(
action: RunnerAction.Test,
filter: filterMode,
},
filter: await readTestFilter(),
filter: filterMode ? await readTestFilter() : null,
};
subscribeTsc(state, onChange);