Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to define snapshot directory name #810

Open
silverwind opened this issue Sep 14, 2023 · 1 comment
Open

Option to define snapshot directory name #810

silverwind opened this issue Sep 14, 2023 · 1 comment
Labels
feature request New feature or request

Comments

@silverwind
Copy link

silverwind commented Sep 14, 2023

Is your feature request related to a problem? Please describe.

I prefer to name my snapshot directory snapshots instead of __snapshots__. I feel the underscores are unnecessary noise.

Describe the solution you'd like

A CLI option --snapshot-dirname <name>

Describe alternatives you've considered

None

Additional context

In JS, I use vitest's resolveSnapshotPath option for the same, it is a bite more flexible as it allows full customization of the path, but I guess I would be happy with a static option just to define the directory name.

@noahnu noahnu added the feature request New feature or request label Nov 1, 2023
@noahnu
Copy link
Collaborator

noahnu commented Nov 1, 2023

It's possible to implement a custom dirname via a custom snapshot extension. I agree though that first-party support would be welcome and preferred.

We reference the snapshot name in a couple places, mostly coming from the base extension abstract class. We don't currently expose syrupy options to the extension itself though. This would be far easier after #816 is implemented. We might be able to come up with a bit more of a hacky solution or workaround until PR 816 and subsequent related changes are merged though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants