Skip to content

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

@dmorgan-fa

Description

@dmorgan-fa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions