Skip to content

LiveDoc tag filters leave pending tests causing non-zero Vitest exit with zero failures #118

@dotnetprofessional

Description

@dotnetprofessional

Summary

When using native @swedevtools/livedoc-vitest tag filters, non-matching scenarios/rules are skipped/pending as expected, but the Vitest process exits with code 1 even when all included tests pass and the report has 0 failures.

This makes it difficult to use LiveDoc status tags as CI/menu lanes, because a lane like status/ready fails the command solely because excluded/quarantined tests remain pending in the loaded spec modules.

Version

  • @swedevtools/livedoc-vitest: 0.2.0
  • vitest: 4.0.18
  • Node/npm project on Windows PowerShell

Filter setup

import { livedoc } from "@swedevtools/livedoc-vitest";

livedoc.options.filters.include = ["status/ready"];
livedoc.options.filters.exclude = ["status/quarantine", "status/active"];

In the local project this is wired from environment variables:

cd D:\dev\AstralAIProxy\tests\AstralProxy.UI
$env:LIVEDOC_INCLUDE_TAGS = 'status/ready'
$env:LIVEDOC_EXCLUDE_TAGS = 'status/quarantine,status/active'
npm test

Expected behavior

If every included scenario/rule/test passes and there are no failures or LiveDoc validation errors, the process exits 0. Filtered-out tests may still be shown as pending/skipped in the report, but they should not fail the command.

Actual behavior

Native filtering appears to select execution correctly, but the process exits 1 with 0 failures.

Observed summary from the run:

  • Feature totals: 44 scenarios, 3 pass, 0 fail, 41 pending, 0 warnings
  • Specification totals: 32 rules, 21 pass, 0 fail, 15 pending
  • Suite totals: 0 pass, 0 fail, 16 pending
  • Process exit: 1

The passing counts are the status/ready lane; the pending counts are excluded/not-ready tests loaded by Vitest.

Why this matters

We want to use LiveDoc tags as the native source of truth for validation lanes, for example:

  • @status/active for the screen currently being implemented
  • @status/ready for the always-green baseline
  • @status/quarantine for visible debt

A file-preselection workaround can avoid the non-zero exit by only passing matching files to Vitest, but that hides the native filtering behavior and makes the lane semantics less accurate.

Could the reporter/filter integration treat filter-pending items as non-failing for the process exit, or expose an option to do so?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions