-
Notifications
You must be signed in to change notification settings - Fork 219
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
Feature Request: Provide a way of simplifying snapshot name #549
Comments
I would suggest making the naming schema configurable. |
@Chrisjc28 (or anyone) mind elaborating on the "why"? Would help prioritizing if some use cases were provided. |
We had a recent issue where the memory reference was being used in the name of the snapshot, when running locally all of our tests worked fine. However when running in our CI the test would use a different memory reference in the name causing them to fail. This is a niche issue but if we were able to have more control over what the file name was this wouldn't have happened. We have put something in place as a temporary fix but it has place a code smell in our project i would rather not have. |
I've seen this before with usages of TestParameterInjector with custom provided values. In those cases, providing a toString method or implementing as a data class is the suggested fix. |
In our case we have used a secondary constructor and it's being changed to a data class, however there is no benefit for us to have the data class. An example of the class we are using in our test is -
For us converting loading to a data class has no benefit and makes us have to make use of a secondary constructor just so we don't have to and parentheses to every instance of loading. The suggestion of using toString would you mean to implement that in the loading object itself? |
Being able to specify a custom filename would be great, instead of the hard-coded list which includes things like packagename
Being able to provide a custom filename would allow me to remove the packageName part, which is the same for all my tests e.g. |
I would like this, the excessive name also makes it truncate in github and makes it hard to find files in finder. |
Adds a FileNameProvider that can be implemented in any way to specify file names for a recorded Snapshot. Closes feature request cashapp#549
Adds a FileNameProvider that can be implemented in any way to specify file names for a recorded Snapshot. Closes feature request cashapp#549
Adds a FileNameProvider that can be implemented in any way to specify file names for a recorded Snapshot. Closes feature request cashapp#549
There's a nice PR for this feature and it seems like it's widely requested. Any reasons not to merge it? |
Description
It would be great if the snapshot didn't have to have all of the values in it such as the package name, class name and the method name and you could provide a custom name with only the details you wanted.
The text was updated successfully, but these errors were encountered: