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:
Or include only in individual tests:
const serializer = ; expect;