From 408258268edb5acdfdbf77bc6e0b0dc6396c0e6f Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Tue, 4 Jun 2024 07:09:58 +0800 Subject: [PATCH] fix: 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. --- compiler/packages/snap/src/runner-watch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/packages/snap/src/runner-watch.ts b/compiler/packages/snap/src/runner-watch.ts index 6a229f5155..bebedef721 100644 --- a/compiler/packages/snap/src/runner-watch.ts +++ b/compiler/packages/snap/src/runner-watch.ts @@ -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);