Skip to content

Option to hide fixture nodes from test explorer tree #762

Description

@kvet

Clear and concise description of the problem

As a developer using Vitest with test.extend() for DI/fixture composition, I want fixture nodes to be hidden (or collapsible) in the test explorer tree so that I can focus on actual test cases. Currently every .extend('name', factory) call appears as a separate node, and in larger test files with 15+ fixtures the tree becomes very hard to navigate.

Suggested solution

Either: (1) don't show fixture nodes in the test explorer tree at all — only show describe blocks and test cases, or (2) add a setting like vitest.explorer.showFixtures: false to let users opt out, or (3) collapse fixture nodes under a single "fixtures" group.

Alternative

Using the object overload of .extend({ foo: ..., bar: ... }) instead of chaining individual .extend('name', fn) calls. But this changes the API semantics and may not reduce the nodes.

Additional context

This happens even when the file has TypeScript compilation errors (the discovery runs on esbuild-transformed source). Vitest 4.1.0, extension 1.48.1, Node v22.22.0, macOS arm64. Screenshot of the problem: (attach your screenshot)

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions