2.0.0 • Published 3 years ago

jss-snapshot-serializer v2.0.0

Weekly downloads
142
License
MIT
Repository
github
Last release
3 years ago

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