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

Differencify appends indexes to a unique generated snapshots' names. #157

Open
mariyan-dimitrov opened this issue Sep 4, 2019 · 3 comments

Comments

@mariyan-dimitrov
Copy link

mariyan-dimitrov commented Sep 4, 2019

Hey @NimaSoroush ,
I'm using differencify for a year now and now I'm looking to extend the library even more
My issue is that I don't want to append incrementing indexes to uniquely generated names for the snapshots.
My whole idea is to rerun a single test from an array of tests ( which were generated a few days back), but the thing is that Differencify doesn't take the already generated snapshot as a base one, but generates a new one.
Could you please advice how can I remove the default indexing of the snapshots' naming?

@NimaSoroush
Copy link
Owner

Hi @mariyan-dimitrov : If I understood your use case well, you want to override the existing prefix in differencify and instead providing your own test names which you can use it against an array of test. If that is the case, you can provide testName as an option. https://github.com/NimaSoroush/differencify#testoptions

Forexample: https://github.com/NimaSoroush/differencify/blob/master/API.md#simple-unchained

Hope this helps

@mariyan-dimitrov
Copy link
Author

Hi @NimaSoroush,
I don't think you understood me correctly. My current case is that I'm trying to run 5 tests at the same time. Meanwhile I'm providing unique testName for each of these test (ex. "unique_test_name_1", "unique_test_name_2", ... ), but then again, the differencify appends another index to these names like:
-> "unique_test_name_1 1.snap", "unique_test_name_2 2.snap"...
-> "unique_test_name_1 1.differencify.snap", "unique_test_name_2 2.differencify.snap" ...
-> "unique_test_name_1 1.current.snap" , "unique_test_name_2 2.current.snap" ...
I want to remove the second index ( unique_test_name_1 1.current.snap ) which is coming from Differencify.
Is there any way to do that without renaming the file after it's created by the library?

@NimaSoroush
Copy link
Owner

Hey @mariyan-dimitrov , Thanks for clarifying the issue. I misunderstood it initially. The short answer is that, it is not possible to remove the test name postfix with the current implementation. But it is fairly easy to implement that. Feel free to raise a PR for it

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

2 participants