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

Package detail

@uifabric/jest-serializer-merge-styles

microsoft3.9kMIT7.2.6TypeScript support: included

Jest serializer for merge-styles.

readme

@uifabric/jest-serializer-merge-styles

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

Overview

When using Jest snapshot testing with components that use @uifabric/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 - @uifabric/jest-serializer-merge-styles

This log was last generated on Mon, 31 Oct 2022 12:21:19 GMT and should not be manually modified.

7.2.6

Mon, 31 Oct 2022 12:21:19 GMT Compare changes

Patches

7.2.5

Fri, 30 Sep 2022 21:44:22 GMT Compare changes

Patches

7.2.4

Thu, 01 Sep 2022 23:27:06 GMT Compare changes

Patches

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