Skip to content

Test runner: add 'testOnly' parameter to 'run' function #49733

@koshic

Description

@koshic

What is the problem this feature will solve?

As a developer, I want to be able use test runner programmatically via 'run' function and execute only tests marked with 'only' option. Currently it's possible only via CLI be adding '--test-only' parameter, or with dirty hack (see alternatives section).

What is the feature you are proposing to solve the problem?

Add 'testOnly' to 'run' parameters, similar to existing 'watch' or 'testNamePatterns'. It would be nice to have all test runner options available both on CLI and runtime API.

What alternatives have you considered?

Add '--test-only' to NODE_OPTIONS env variable before 'run' call. It works fine, but looks a bit ugly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions