1.1.24 • Published 7 days ago

@griffel/jest-serializer v1.1.24

Weekly downloads
-
License
MIT
Repository
github
Last release
7 days ago

Jest serializer for Griffel

Provides a Jest serializer for @griffel/react which removes class names.

Install

Add it as a dependency:

yarn add --dev @griffel/jest-serializer
# or
npm install --save-dev @griffel/jest-serializer

Update your jest.config.js (or appropriate config location) to include a snapshotSerializers array that references this package:

module.exports = {
  snapshotSerializers: ['@griffel/jest-serializer'],
};

Overview

When using Jest snapshot testing with components that use @griffel/react, classes will be rendered as such:

<div class="static-class __1qdh4ig f16th3vw frdkuqy0 fat0sn40 fjseox00">Hello world</div>

Using this serializer, the generated class names will be stripped:

<div class="static-class">Hello world</div>

This means that your tests can pass reliably (no generated class names) and your rules get included in the snapshot. I.e. snapshots doesn't need update when CSS is altered.)

1.1.24

7 days ago

1.1.23

2 months ago

1.1.22

4 months ago

1.1.12

10 months ago

1.1.11

11 months ago

1.1.16

9 months ago

1.1.15

9 months ago

1.1.14

10 months ago

1.1.13

10 months ago

1.1.19

6 months ago

1.1.18

7 months ago

1.1.17

8 months ago

1.1.21

5 months ago

1.1.20

6 months ago

1.1.10

11 months ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.11

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.10

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago