Skip to content

Explain diff gutter symbols #1558

Closed
@wmertens

Description

@wmertens

Issuehunt badges

Please see this comment: #1558 (comment)

Original issue follows.


Description

When using t.snapshot(foo) and foo does not match the snapshot, the diff that is shown uses - to indicate the new foo values and + to show the old foo values.

This is unintuitive.

I believe the problem may be at

values: [formatDescriptorDiff(result.actual, result.expected, {invert: true})]

Test Source

import test from 'ava'
test('snapshot diff', t => {
  t.snapshot(`\n${Date.now()}\n`, 'the - value should be less than the + value')
})

Environment

Latest stable ava on OS X


IssueHunt Summary

Backers (Total: $60.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions