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.
XiaoPi committed
Jun 7, 2024 at 01:48 UTC
70194be4038158f5ba8e55e27f7ffd02be13bbca
1 file changed
+2
-1
compiler/packages/snap/src/runner-watch.ts
+2
-1
@@ -189,7 +189,7 @@ function subscribeKeyEvents(
189
state: RunnerState,
190
onChange: (state: RunnerState) => void
191
) {
192
- process.stdin.on("keypress", (str, key) => {
192
+ process.stdin.on("keypress", async (str, key) => {
193
if (key.name === "u") {
194
// u => update fixtures
195
state.mode.action = RunnerAction.Update;
@@ -197,6 +197,7 @@ function subscribeKeyEvents(
197
process.exit(0);
198
} else if (key.name === "f") {
199
state.mode.filter = !state.mode.filter;
200
+ state.filter = state.mode.filter ? await readTestFilter() : null;
201
state.mode.action = RunnerAction.Test;
202
} else {
203
// any other key re-runs tests