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

Shorten snapshot file names? #377

Open
max-sixty opened this issue Jun 4, 2023 · 1 comment
Open

Shorten snapshot file names? #377

max-sixty opened this issue Jun 4, 2023 · 1 comment

Comments

@max-sixty
Copy link
Collaborator

This might be too much of a breaking change, or I might be misunderstanding the structure, but: we current have snapshots at a path like:

web/book/tests/examples/snapshots/examples__book__introduction__0.snap

This is from an assert_snapshot! in web/book/tests/examples/book.rs with a snapshot name of introduction/0.

Given that the snapshots are already in the path examples, is there a reason to prefix the filename of the snapshot with examples__? Could the name of the snapshot instead just be:

web/book/tests/examples/snapshots/book__introduction__0.snap
@max-sixty
Copy link
Collaborator Author

max-sixty commented Jun 26, 2024

One option is to write new snapshots with the shorter name while supporting older snapshots with longer names.

It would be technically possible to have conflicts, but extremely unlikely (in the example above, we'd need a module web/book/tests/examples/examples/book.rs containing a test with exactly the same name, and the new module would have to write with the new naming scheme, while the old module remains on the existing naming scheme).

Happy to give this a go if it would get merged...

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

No branches or pull requests

1 participant