Skip to content
Kepler Sticka-Jones

jest-serializer-json-ld-script

Status: active​​Role: creator, maintainer​​GitHub​​npm​​

Jest-serializer-json-ld-script is a Jest Serializer to correctly display JSON-LD objects in Jest snapshots.

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"]
  }
}

License

Copyright 2019-2020 Kepler Sticka-Jones. Licensed ISC