fix<compiler>: reread the testfilter file if filter enabled during the watch process (#29775)

Resolve #29720
In the above PR, I overlooked that we can change the filter mode during the watch process. Now it's fixed.
This commit is contained in:
XiaoPi
2024-06-07 01:48:24 +08:00
committed by GitHub
parent 1e1e5cd252
commit 70194be403

View File

@@ -189,7 +189,7 @@ function subscribeKeyEvents(
state: RunnerState,
onChange: (state: RunnerState) => void
) {
process.stdin.on("keypress", (str, key) => {
process.stdin.on("keypress", async (str, key) => {
if (key.name === "u") {
// u => update fixtures
state.mode.action = RunnerAction.Update;
@@ -197,6 +197,7 @@ function subscribeKeyEvents(
process.exit(0);
} else if (key.name === "f") {
state.mode.filter = !state.mode.filter;
state.filter = state.mode.filter ? await readTestFilter() : null;
state.mode.action = RunnerAction.Test;
} else {
// any other key re-runs tests