jest-serializer-ansi

Jest serializer to strip ANSI escape codes

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
jest-serializer-ansi
3161.0.35 years ago5 years agoMinified + gzip package size for jest-serializer-ansi in KB

Readme

jest-serializer-ansi
Jest serializer to strip ANSI escape codes
Installation
npm install --save-dev jest-serializer-ansi

yarn add jest-serializer-ansi

Add the serializer to snapshotSerializers field in your package.json as follows:
{
  ...
  "jest": {
    "snapshotSerializers": [
      "jest-serializer-ansi"
    ]
  }
}

Or include only in individual tests:
const serializer = require('jest-serializer-ansi');

expect.addSnapshotSerializer(serializer);