SwissLife-OSS / snapshooter

Snapshooter is a snapshot testing tool for .NET Core and .NET Framework
https://swisslife-oss.github.io/snapshooter/
MIT License
302 stars 29 forks source link

I would like to Configure the name of the snapshooter files #171

Open ncmindera opened 1 year ago

ncmindera commented 1 year ago

Is your feature request related to a problem? Please describe. the files generated are too long and can't go to git

Describe the solution you'd like I would like to be able to configure the snapshooter file names pattern to something shorter, or just have a guid generated for each combination of class, method, params.

e.g. for the test in this class ClassTests.TestName.TestCaseParams => The file create is a Guid -> 2d5aa143-37c0-4422-bcf9-8489eb6e548e.snap

inside this file you guys can have the long name you usually generate, plus the data.

{
     "snapshot_name": "the long name you have now", 
     "snapshot_data": {
         "someData" : "data to match with"
      }
}

by doing this each file has the same length (36 char), that is in general much shorter too. this way is more stable in my opinion, because nobody cares about those files, we just care about the match, we don't want this files to get us into any trouble.

Describe alternatives you've considered Alternative is to change method name, or use another snapshot tool.

Additional context I don't like the idea of having to change method names because Snapshooter generates long file names that can go to git. this is because some of our tests have long names.