NimaSoroush / differencify

Differencify is a library for visual regression testing
MIT License
634 stars 46 forks source link

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

Open mariyan-dimitrov opened 4 years ago

mariyan-dimitrov commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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