Skip to content

[Feature]: outputFile support for listTests option #14943

@manoraj

Description

@manoraj

🚀 Feature Proposal

Right now, the --listTests option will just write the list of tests to the console. My proposal is to use the --outputFile option along with the --listTests option to write the output to the file.

Motivation

We wanted to use the list of tests in the custom sequencers. This feature will help to store the list in the file so that the sequencers can access it.

Note that this is just my usecase. There may be different use cases as well.

Example

Pass --outputFile=test-lists.json along with --listTests

yarn test --listTests --json --outputFile=test-lists.json

Pitch

The listTests option is a core feature of Jest and would be great if it support --outputFile as well

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions