Closed gkampitakis closed 1 year ago
This pull request adds back support for allowing configurable snapshot filename and directory name. [ pr tha dropped config ]
Action Items:
Clean
closes #58
Example usage of current api
t.Run("should allow setting filename", func(t *testing.T) { snaps.WithConfig(snaps.Filename("my_custom_name")).MatchSnapshot(t, "Hello Word") snaps.WithConfig(snaps.Dir("my_dir")).MatchSnapshot(t, 10, 20, 30) snaps.WithConfig(snaps.Filename("my_custom_name")).MatchSnapshot(t, "Hello Word") snaps.WithConfig(snaps.Dir("my_dir")).MatchSnapshot(t, 10, 20, 30) snaps.WithConfig(snaps.Dir("my_dir"), snaps.Filename("json_file")).MatchJSON(t, `{"hello":"world"}`) snaps.WithConfig(snaps.Dir("json_dir"), snaps.Filename("blue_file")).MatchJSON(t, `{"hello":"world"}`) })
This pull request adds back support for allowing configurable snapshot filename and directory name. [ pr tha dropped config ]
Action Items:
Clean
functionalitycloses #58
Example usage of current api