Skip to content

Serializer to correctly display JSON-LD objects in Jest snapshots

License

Notifications You must be signed in to change notification settings

keplersj/jest-serializer-json-ld-script

Folders and files

NameName
Last commit message
Last commit date
Aug 15, 2019
Nov 21, 2019
Aug 20, 2019
Aug 20, 2019
Aug 15, 2019
Sep 22, 2019
Aug 27, 2019
Aug 3, 2021
Jul 24, 2021
Jan 25, 2020
Nov 21, 2019

Repository files navigation

jest-serializer-json-ld-script

Build Status npm version Code Coverage Mentioned in Awesome Jest

Jest Snapshot serializer to better visualize React <script> elements containing LD+JSON data.

Installation

Install preset using npm:

npm install --save-dev jest-serializer-json-ld-script

or yarn:

yarn add --dev jest-serializer-json-ld-script

Usage

Configure Jest to use the serializer in jest.config.js:

module.exports = {
  snapshotSerializers: ["jest-serializer-json-ld-script"]
};

or package.json:

{
  "jest": {
    "snapshotSerializers": ["jest-serializer-json-ld-script"]
  }
}

Related Packages

License

Copyright 2019 Kepler Sticka-Jones. Licensed ISC