Skip to content

Feature request: Support snapshot testing #14936

Open

Description

We test rules with a custom rule tester doing a snapshot test.

The built-in RuleTester can't customize the output assertion, we don't have the output to send to RuleTester, so we have to use SourceCodeFixer to apply fix from messages. Full implementation

We definitely want a better way to do snapshot test, maybe pass an assert option in future, but before that, can we expose SourceCodeFixer, so I can apply fix from the message?

The version of ESLint you are using.

8.0.0-beta.0

The problem you want to solve.

Fix our rule tester.

Are you willing to submit a pull request to implement this change?

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

coreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintneeds designImportant details about this change need to be discussedImportant details about this change need to be discussed

Type

No type

Projects

  • Status

    Waiting for RFC

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions