1.1.30 • Published 8 months ago

@griffel/jest-serializer v1.1.30

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Jest serializer for Griffel

Provides a Jest serializer for @griffel/react that strips out class names generated by Griffel from the output.

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 utilize @griffel/react, class names will be rendered as follows:

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

With this serializer, the generated class names will be removed:

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

This ensures that your tests can pass reliably without any generated class names.

1.1.30

8 months ago

1.1.29

11 months ago

1.1.28

11 months ago

1.1.27

11 months ago

1.1.26

11 months ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.11

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.10

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago