mirror of
https://github.com/hanzoai/jest.git
synced 2026-09-24 16:59:57 +00:00
* 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
813 B
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);