MCPcopy
hub / github.com/vitest-dev/vitest / processCollected

Function processCollected

packages/vitest/src/node/cli/cli-api.ts:190–211  ·  view source on GitHub ↗
(ctx: Vitest, files: TestModule[], options: CliOptions)

Source from the content-addressed store, hash-verified

188}
189
190export function processCollected(ctx: Vitest, files: TestModule[], options: CliOptions): void {
191 let errorsPrinted = false
192
193 forEachSuite(files, (suite) => {
194 suite.errors().forEach((error) => {
195 errorsPrinted = true
196 ctx.logger.printError(error, {
197 project: suite.project,
198 })
199 })
200 })
201
202 if (errorsPrinted) {
203 return
204 }
205
206 if (typeof options.json !== 'undefined') {
207 return processJsonOutput(files, options)
208 }
209
210 return formatCollectedAsString(files).forEach(test => console.log(test))
211}
212
213export function outputFileList(files: TestSpecification[], options: CliOptions): void {
214 if (typeof options.json !== 'undefined') {

Callers 1

collectFunction · 0.85

Calls 5

forEachSuiteFunction · 0.85
processJsonOutputFunction · 0.85
formatCollectedAsStringFunction · 0.85
printErrorMethod · 0.80
logMethod · 0.45

Tested by

no test coverage detected