Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@fluentui/jest-serializer-merge-styles

microsoft1.6kMIT8.0.47TypeScript support: included

Jest serializer for merge-styles.

readme

@fluentui/jest-serializer-merge-styles

Provides a Jest serializer for @fluentui/merge-styles which expands class names into css rules.

Overview

When using Jest snapshot testing with components that use @fluentui/merge-styles, class names may be rendered as such in the snapshot (Note the css-2342 generated class name):

<div className='ms-Foo css-2432'>
  Hello world
</div>

Using this serializer, the generated css-2342 class name will be auto expanded to the rules resolved by merge-styles:

<div
  className=
      ms-Foo
      {
        background-color: #f4f4f4;
        box-sizing: border-box;
        color: #333333;
        cursor: pointer;
      }
      &:hover {
        background-color: #f8f8f8;
      }
>
  Hello world
</div>

This means that your tests can pass reliably (no generated class names) and your rules get included in the snapshot. (Snapshots need updates when css is altered.)

Usage

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

module.exports = {
  snapshotSerializers: [path.resolve(__dirname, 'jest-serializer-merge-styles')],
};

See Testing for more detailed usage.

changelog

Change Log - @fluentui/jest-serializer-merge-styles

This log was last generated on Fri, 21 Feb 2025 07:20:19 GMT and should not be manually modified.

8.0.47

Fri, 21 Feb 2025 07:20:19 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.14 (PR #33879 by beachball)

8.0.46

Thu, 08 Aug 2024 07:24:18 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.13 (commit by beachball)

8.0.45

Tue, 25 Jun 2024 07:32:52 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.12 (commit by beachball)

8.0.44

Mon, 24 Jun 2024 07:33:22 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.11 (commit by beachball)

8.0.43

Fri, 14 Jun 2024 15:25:28 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.10 (PR #31716 by beachball)

8.0.42

Thu, 06 Jun 2024 07:26:46 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.9 (commit by beachball)

8.0.41

Tue, 28 May 2024 07:28:20 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.8 (PR #31324 by beachball)

8.0.40

Fri, 24 May 2024 07:28:17 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.7 (commit by beachball)

8.0.39

Thu, 23 May 2024 07:28:51 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.6 (commit by beachball)

8.0.38

Mon, 20 May 2024 07:29:20 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.5 (commit by beachball)

8.0.37

Wed, 24 Apr 2024 07:27:48 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.4 (PR #31130 by beachball)

8.0.36

Mon, 22 Apr 2024 07:28:25 GMT Compare changes

Patches

8.0.35

Fri, 12 Apr 2024 07:29:11 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.2 (PR #31022 by beachball)

8.0.34

Wed, 03 Apr 2024 07:29:31 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.1 (PR #30943 by beachball)

8.0.33

Wed, 13 Mar 2024 07:30:28 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.6.0 (PR #30753 by beachball)

8.0.32

Wed, 10 Jan 2024 07:28:50 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.15 (PR #30063 by beachball)

8.0.31

Thu, 14 Dec 2023 07:30:10 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.14 (PR #30061 by beachball)

8.0.30

Sat, 28 Oct 2023 00:29:16 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.13 (commit by beachball)

8.0.29

Wed, 31 May 2023 07:38:40 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.12 (commit by beachball)

8.0.28

Tue, 30 May 2023 07:36:09 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.11 (PR #27685 by beachball)

8.0.27

Fri, 05 May 2023 18:14:04 GMT Compare changes

Patches

8.0.26

Tue, 02 May 2023 00:58:19 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.9 (PR #27736 by beachball)

8.0.25

Mon, 01 May 2023 07:39:54 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.8 (PR #27724 by beachball)

8.0.24

Fri, 17 Mar 2023 08:15:56 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.7 (PR #27210 by beachball)

8.0.23

Fri, 03 Feb 2023 07:50:06 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.6 (PR #26569 by beachball)

8.0.22

Tue, 10 Jan 2023 07:50:15 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.5 (PR #26260 by beachball)

8.0.21

Wed, 09 Nov 2022 07:48:12 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.4 (PR #25564 by beachball)

8.0.20

Mon, 08 Aug 2022 07:39:33 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.3 (PR #24212 by beachball)

8.0.19

Fri, 13 May 2022 07:45:35 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.2 (PR #22966 by beachball)

8.0.18

Fri, 15 Apr 2022 07:42:48 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.1 (PR #22499 by beachball)

8.0.17

Fri, 11 Mar 2022 07:34:41 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.5.0 (PR #22047 by beachball)

8.0.16

Thu, 03 Mar 2022 07:24:29 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.4.0 (PR #21919 by beachball)

8.0.15

Thu, 03 Feb 2022 07:29:41 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.3.0 (PR #21545 by beachball)

8.0.14

Mon, 03 Jan 2022 23:32:11 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.2.3 (PR #20954 by beachball)

8.0.13

Thu, 25 Nov 2021 14:54:16 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.2.2 (PR #20784 by beachball)

8.0.12

Wed, 10 Nov 2021 07:31:59 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.2.1 (PR #20529 by beachball)

8.0.11

Tue, 28 Sep 2021 22:17:07 GMT Compare changes

Patches

  • Bump @fluentui/merge-styles to v8.2.0 (PR #20000 by beachball)

8.0.10

Wed, 25 Aug 2021 07:35:19 GMT Compare changes

Patches

8.0.9

Tue, 03 Aug 2021 07:39:30 GMT Compare changes

Patches

8.0.8

Fri, 09 Jul 2021 07:39:31 GMT Compare changes

Patches

8.0.7

Mon, 07 Jun 2021 07:38:15 GMT Compare changes

Patches

8.0.6

Thu, 20 May 2021 07:41:54 GMT Compare changes

Patches

8.0.5

Fri, 30 Apr 2021 07:42:23 GMT Compare changes

Patches

8.0.4

Fri, 23 Apr 2021 07:37:10 GMT Compare changes

Patches

8.0.3

Wed, 31 Mar 2021 00:53:43 GMT Compare changes

Patches

8.0.2

Wed, 03 Mar 2021 00:10:09 GMT Compare changes

Patches

8.0.1

Fri, 26 Feb 2021 01:16:27 GMT Compare changes

Patches

8.0.0-beta.7

Mon, 22 Feb 2021 12:26:22 GMT Compare changes

Changes

8.0.0-beta.6

Thu, 18 Feb 2021 12:27:34 GMT Compare changes

Changes

8.0.0-beta.4

Thu, 21 Jan 2021 12:36:12 GMT Compare changes

Changes

8.0.0-beta.0

Fri, 23 Oct 2020 03:26:15 GMT Compare changes

Changes

7.1.0

Tue, 25 Aug 2020 12:36:19 GMT Compare changes

Minor changes

7.0.21

Thu, 07 May 2020 01:06:55 GMT Compare changes

Patches

7.0.15

Wed, 25 Mar 2020 12:30:04 GMT

Patches

Patches

  • Replace OfficeDev/office-ui-fabric-react with microsoft/fluentui (elcraig@microsoft.com)

    7.0.6

    Wed, 04 Sep 2019 04:09:58 GMT

Patches

Patches

7.0.4

Wed, 17 Jul 2019 18:58:57 GMT

Patches

  • Adding @types/react and @types/react-dom to package.json that have peer dependencies on react and react-dom. (makotom@microsoft.com)

7.0.3

Mon, 01 Jul 2019 18:51:42 GMT

Patches

  • adds react-app-polyfill

7.0.2

Fri, 14 Jun 2019 12:26:30 GMT

Patches

  • Fix missing assets in production build.

7.0.1

Thu, 13 Jun 2019 00:24:48 GMT

Patches

  • Initial release of Fabric 7

6.0.10

Wed, 12 Jun 2019 00:42:26 GMT

Patches

  • Update and dedupe React deps.

6.0.9

Tue, 14 May 2019 07:50:30 GMT

Patches

  • Update Fabric assets link

6.0.8

Tue, 02 Apr 2019 00:38:15 GMT

Patches

  • Use ^ ranges instead of >=

6.0.7

Tue, 15 Jan 2019 13:36:45 GMT

Patches

  • Keyframes no longer cause merge-styles jest serialization to throw an exception.

6.0.6

Mon, 08 Oct 2018 12:24:15 GMT

Patches

  • Moving tslint/prettier dependencies

6.0.5

Fri, 21 Sep 2018 14:25:46 GMT

Patches

  • Adding a version stamp file

6.0.4

Tue, 14 Aug 2018 10:27:33 GMT

Patches

  • disabling codepen task

6.0.3

Thu, 14 Jun 2018 20:52:57 GMT

Patches

  • Fix broken documentation links

6.0.0

Tue, 05 Jun 2018 00:44:30 GMT

Breaking changes

  • Major bump to 6.0 to be in line with rest of OUFR v6 packages.

Patches

  • Added Prettier

5.2.3

Mon, 04 Jun 2018 10:16:13 GMT

Patches

  • Updating react typings.

5.2.2

Wed, 30 May 2018 22:05:03 GMT

Version update only

5.2.1

Mon, 21 May 2018 10:29:16 GMT

Patches

  • The animation-name values reference class names which should be expanded if there is a comma delimited list of them.

5.2.0

Mon, 23 Apr 2018 10:24:54 GMT

Minor changes

  • Updating how keyframe classes are serialized in results.

5.1.0

Sat, 16 Dec 2017 05:07:22 GMT

Minor changes

  • Updated build to newest React version and typings. Updated tests and made various tweaks to the code to remove React warnings and keep Enzyme

5.0.1

Tue, 24 Oct 2017 10:21:08 GMT

Patches

  • Updated jest docs

5.0.0

Tue, 17 Oct 2017 17:17:41 GMT

Initial release