You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a rule contains an auto-fix program, I want to test if the output of the fix meets my expectations. The simplest way is to use snapshot testing and check if the snapshot matches the expected result.
However, now I need to manually maintain strict formatting for indentation, spaces, and other formatting-related outputs.
I also need to use dedent to ensure consistent indentation. This is too troublesome.
If I want to optimize the auto-fixing process, I also need to manually synchronize the output of the tests (sometimes it may be just one extra or missing space, which should not matter because it will eventually be formatted by Prettier).
bradzacher
added
question
Questions! (i.e. not a bug / enhancment / documentation)
and removed
triage
Waiting for team members to take a look
repo maintenance
things to do with maintenance of the repo, and not with code/docs
labels
Aug 10, 2023
Motivation
When a rule contains an auto-fix program, I want to test if the output of the fix meets my expectations. The simplest way is to use snapshot testing and check if the snapshot matches the expected result.
However, now I need to manually maintain strict formatting for indentation, spaces, and other formatting-related outputs.
I also need to use
dedent
to ensure consistent indentation. This is too troublesome.If I want to optimize the auto-fixing process, I also need to manually synchronize the output of the tests (sometimes it may be just one extra or missing space, which should not matter because it will eventually be formatted by Prettier).
Example
https://github.com/u3u/eslint-plugin-arrow-return-style/blob/bfa3cc81f15526aa76fe1b043d0a394ffe3be2ba/src/rules/arrow-return-style.test.ts
The text was updated successfully, but these errors were encountered: