public updateStatus()

in src/test-runner/run-tracker.ts [146:179]


  public updateStatus(
    item: vscode.TestItem,
    status: TestCaseStatus,
    message?: vscode.TestMessage
  ) {
    const currentStatus = this.status.get(item)
    if (currentStatus && status < currentStatus) {
      // Only update if the new status is ranked higher than the existing one.
      // This allows multiple updates to be made to a test item, while only showing the highest status in the UI.
      return
    }

    this.status.set(item, status)
    switch (status) {
      case TestCaseStatus.Started:
        this.run.started(item)
        break
      case TestCaseStatus.Failed:
        this.run.failed(item, message ?? new vscode.TestMessage(''))
        break
      case TestCaseStatus.Errored:
        this.run.errored(item, message ?? new vscode.TestMessage(''))
        break
      case TestCaseStatus.Passed:
        this.run.passed(item)
        break
      case TestCaseStatus.Inherit:
        break
      case TestCaseStatus.Skipped:
      default:
        this.run.skipped(item)
        break
    }
  }