Skip to content

cssinjs/jss-snapshot-serializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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