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

Method updateId

packages/vitest/src/node/state.ts:196–217  ·  view source on GitHub ↗
(task: Task, project: TestProject)

Source from the content-addressed store, hash-verified

194 }
195
196 updateId(task: Task, project: TestProject): void {
197 if (this.idMap.get(task.id) === task) {
198 return
199 }
200
201 if (task.type === 'suite' && 'filepath' in task) {
202 TestModule.register(task, project)
203 }
204 else if (task.type === 'suite') {
205 TestSuite.register(task, project)
206 }
207 else {
208 TestCase.register(task, project)
209 }
210
211 this.idMap.set(task.id, task)
212 if (task.type === 'suite') {
213 task.tasks.forEach((task) => {
214 this.updateId(task, project)
215 })
216 }
217 }
218
219 getReportedEntity(task: Task): TestModule | TestCase | TestSuite | undefined {
220 return this.reportedTasksMap.get(task)

Callers 1

collectFilesMethod · 0.95

Calls 3

getMethod · 0.45
registerMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected