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

Request: Remove the snapshot content from the rspec description #48

Open
dmorgan-fa opened this issue May 16, 2024 · 0 comments · May be fixed by #49
Open

Request: Remove the snapshot content from the rspec description #48

dmorgan-fa opened this issue May 16, 2024 · 0 comments · May be fixed by #49

Comments

@dmorgan-fa
Copy link

dmorgan-fa commented May 16, 2024

Hi @levinmr, thanks for creating and maintaining this gem, it's super useful.

One thing that I've noticed that's a bit frustrating is that the entire snapshot content is included in the rspec description:

def description
"to match a snapshot containing: \"#{@expected}\""
end

This means if you're looking through the logs, debugging a failure, etc., you can end up with a really long rspec log file with:

is expected to to match a snapshot containing: <entire contents of the snapshot>

for a few hundred or thousand lines.

It's not really valuable to have the contents in the rspec output like this, and if the spec fails the failure message then includes a duplicate of it along with the actual results, increasing the overall output again.

How would you feel about alternatives:

  • make it optional to include the contents in the description
  • drop the snapshot contents and provide a generic/customisable description instead
  • provide a link to the snap file instead of the contents?

I'm happy to have a look and raise a PR if you're open to the suggestion.

dmorgan-fa added a commit to dmorgan-fa/rspec-snapshot that referenced this issue May 20, 2024
# What
Provide the snapshot file path rather than the contents of the snapshot in rspec description.

The snapshot can be many hundreds/thousands of lines long, and doesn't provide much benefit as the description.

- resolves: levinmr#48
@dmorgan-fa dmorgan-fa linked a pull request May 20, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant