CodeVetter · Repo Unpack · Data flow
vitest-dev/vitest
CLI arguments become resolved Vite and Vitest configuration before producing project-specific test specifications. Execution transports module requests toward the coordinator and task updates back from workers. Snapshot state remains local to a running file until its summary is aggregated, while result caches retain scheduling information across runs. The UI maintains its own reactive representation of coordinator events.
- CLI normalization converts exclude into cliExclude and enables locations for colon filters; prepareVitest sets TEST/VITEST and default NODE_ENV, then passes options into createVitest.
- Project definitions become resolved entries; undefined definitions use the root entry, nested containers contribute tracked configuration paths, and duplicate project names are checked.
- Worker fetch requests enter createMethodsRPC.fetchModule and project._transformService.fetch; returned externalizations, temporary paths, and direct-fetch durations populate project metadata.
- collectTests creates a file task, clears collector context, runs setupFiles, imports the test module, and assembles its collected tasks; specifications carry location, name, ID, and tag filters.
- resolveTestRunner wraps task-update callbacks with worker RPC; coordinator handlers route collection and updates either directly into StateManager or through _testRun, depending on collection mode.
- SnapshotClient stores SnapshotState by filepath, forwards matcher input into state.match, and finishes through state.pack; worker snapshotSaved results are added to the coordinator SnapshotManager.
- ResultsCache writes results.json under config.dir with versioned entries keyed by project name and root-relative filepath; each retained result stores duration and failure status.
- The live UI receives collected task trees, result packs, logs, artifacts, and completion events; it updates client state and explorer state, while static reports use a separate client factory.