Explain diff gutter symbols
See original GitHub issuePlease see this comment: https://github.com/avajs/ava/issues/1558#issuecomment-469031454
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 https://github.com/avajs/ava/blob/14f7095d25abc5ffbff7efd7db962eaf5e86daab/lib/assert.js#L321
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)
issuehunt ($60.00)
Submitted pull Requests
Become a backer now!
Or submit a pull request to get the deposits!
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
IssueHunt has been backed by the following sponsors. Become a sponsor
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Settings - GitGutter Documentation
GitGutter provides support for custom gutter icons and diff popup style sheets coming with theme packages. Set theme to a valid theme file...
Read more >Icon reference | IntelliJ IDEA Documentation - JetBrains
Gutter icons are located in the editor on the left. Every icon in the gutter has a tooltip that explains its meaning and...
Read more >Transition and Gutters | Understanding Comics - WordPress.com
McCloud describes six types of panel-to-panel transitions, each requiring a different degree of closure from the reader. The first, and most simple, is...
Read more >What are these arrow (») and plus and minus symbols that just ...
The plus and minus signs seem to be git diff symbols, but before it used to be ... plus or minus symbol controlled...
Read more >GitGutter - Package Control
Gutter Icons indicating inserted, modified or deleted lines; Diff Popup with details about modified lines; Status Bar Text with information about file and ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@arteniioleg Jest should only be confusing if you assume the colors have the same purpose, they don’t. In Git the colors signifies changes, with green signifying added/new, and red, removed/old. Whereas in Jest the colors signify (the assumed) correctness of the value, with green signifying correct, and red, incorrect.
In both instances the preceding symbol signifies changes, with
+
signifying added/new, and-
, removed/old.It’s also worth noting that Jest goes quite far in explaining (or at least trying to explain) this concept to the user.
Yes, the way Jest does it looks good!
On Thu, Mar 1, 2018 at 12:53 PM rzec-r7 notifications@github.com wrote: