From 70194be4038158f5ba8e55e27f7ffd02be13bbca Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Fri, 7 Jun 2024 01:48:24 +0800 Subject: [PATCH] fix: 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. --- compiler/packages/snap/src/runner-watch.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/packages/snap/src/runner-watch.ts b/compiler/packages/snap/src/runner-watch.ts index bebedef721..414d99084c 100644 --- a/compiler/packages/snap/src/runner-watch.ts +++ b/compiler/packages/snap/src/runner-watch.ts @@ -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