Skip to content

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

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.

Activity

  1. added
    feature request
    on Sep 20, 2023
  2. added
    test_runner
    on Sep 20, 2023
  3. reopened this on Sep 21, 2023
  4. added a commit that references this issue on Nov 27, 2023
  5. moved this from Awaiting Triage to Done in Node.js feature requestson Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requesttest_runner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions