Skip to content

joaogranado/jest-serializer-ansi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Jest serializer to strip ANSI escape codes

Resources

License

Stars

Watchers

Forks

Packages

No packages published