Skip to content

Commit 4082582

Browse files
authored
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.
1 parent 8b677b1 commit 4082582

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/packages/snap/src/runner-watch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ function subscribeFilterFile(
153153
} else if (
154154
events.findIndex((event) => event.path.includes(FILTER_FILENAME)) !== -1
155155
) {
156-
state.filter = await readTestFilter();
157156
if (state.mode.filter) {
157+
state.filter = await readTestFilter();
158158
state.mode.action = RunnerAction.Test;
159159
onChange(state);
160160
}
@@ -218,7 +218,7 @@ export async function makeWatchRunner(
218218
action: RunnerAction.Test,
219219
filter: filterMode,
220220
},
221-
filter: await readTestFilter(),
221+
filter: filterMode ? await readTestFilter() : null,
222222
};
223223

224224
subscribeTsc(state, onChange);

0 commit comments

Comments
 (0)