Files
Mark PedrottiandGitHub 01faf0b520 chore: Align snapshots in jest-matcher-utils (#8957)
* chore: Align snapshots in jest-matcher-utils

* Use new ConvertAnsi1 plugin in jest-diff and jest-matcher-utils

* Add ConvertAnsi1.ts under plugins in pretty-format

* Delete unneeded .ts file name extension in import statements

* Add alignedAnsiStyleSerializer to test-utils

* Delete ConvertAnsi1 from pretty-format

* Fix prettier lint error

* Add reference to test-utils in tsconfig.json files
2019-09-24 11:05:20 -04:00

813 B

test-utils

Private package exports utilities for multiple end-to-end tests or packages.

alignedAnsiStyleSerializer

Display colors concisely and clearly so we can review changes quickly and confidently:

  • reports when matchers fail
  • annotation and comparison lines from differences

Raw snapshot avoids distracting \\ or \" escape sequences from default string serialization.

Tag names have consistent length to align columns like Expected and Received or comparison lines:

style
b bold
d dim
g green
i inverse
r red
y yellow
Y bgYellow
import {alignedAnsiStyleSerializer} from '@jest/test-utils';

expect.addSnapshotSerializer(alignedAnsiStyleSerializer);