MCPcopy Index your code
hub / github.com/react/react / subscribeFilterFile

Function subscribeFilterFile

compiler/packages/snap/src/runner-watch.ts:145–163  ·  view source on GitHub ↗
(
  state: RunnerState,
  onChange: (state: RunnerState) => void,
)

Source from the content-addressed store, hash-verified

143}
144
145function subscribeFilterFile(
146 state: RunnerState,
147 onChange: (state: RunnerState) => void,
148) {
149 watcher.subscribe(PROJECT_ROOT, async (err, events) => {
150 if (err) {
151 console.error(err);
152 process.exit(1);
153 } else if (
154 events.findIndex(event => event.path.includes(FILTER_FILENAME)) !== -1
155 ) {
156 if (state.mode.filter) {
157 state.filter = await readTestFilter();
158 state.mode.action = RunnerAction.Test;
159 onChange(state);
160 }
161 }
162 });
163}
164
165function subscribeTsc(
166 state: RunnerState,

Callers 1

makeWatchRunnerFunction · 0.85

Calls 4

readTestFilterFunction · 0.90
exitMethod · 0.80
onChangeFunction · 0.70
errorMethod · 0.65

Tested by

no test coverage detected