jest-serializer-json-ld-script

v1.0.7
Serializer to correctly display JSON-LD objects in Jest snapshots
jest react react-helmet json jsonld metadata seo unit-testing snapshot-testing and 1 more...

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

npm i jest-serializer-json-ld-script

Metadata

  • ISC
  • Whatever
  • Kepler Sticka-Jones
  • released 3/13/2020

Downloads

Maintainers