Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 666 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 666 Bytes

jss-snapshot-serializer

Jest snapshot serializer for JSS

This adds the styles generated by JSS to your snapshots, so you can detect unwanted style changes using snapshots.

Install

npm install --save-dev jss-snapshot-serializer

Usage

To use the serializer globally for all your tests put the following option to your Jest config:

{
  snapshotSerializers: ['jss-snapshot-serializer']
}

Alternatively, you can add the serializer to a specific test file like this:

import jssSerializer from 'jss-snapshot-serializer';
expect.addSnapshotSerializer(jssSerializer);