Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keplersj/jest-serializer-json-ld-script
Serializer to correctly display JSON-LD objects in Jest snapshots
https://github.com/keplersj/jest-serializer-json-ld-script
jest jest-serializer jest-snapshots json-ld react react-helmet seo snapshot-testing unit-testing
Last synced: 27 days ago
JSON representation
Serializer to correctly display JSON-LD objects in Jest snapshots
- Host: GitHub
- URL: https://github.com/keplersj/jest-serializer-json-ld-script
- Owner: keplersj
- License: isc
- Created: 2019-08-06T19:07:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T02:27:38.000Z (6 months ago)
- Last Synced: 2024-11-11T06:51:57.640Z (about 1 month ago)
- Topics: jest, jest-serializer, jest-snapshots, json-ld, react, react-helmet, seo, snapshot-testing, unit-testing
- Language: TypeScript
- Size: 2.58 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-jest - jest-serializer-json-ld-script
README
# jest-serializer-json-ld-script
[![Build Status](https://travis-ci.org/keplersj/jest-serializer-json-ld-script.svg?branch=master)](https://travis-ci.org/keplersj/jest-serializer-json-ld-script)
[![npm version](https://badge.fury.io/js/jest-serializer-json-ld-script.svg)](https://badge.fury.io/js/jest-serializer-json-ld-script)
[![Code Coverage](https://codecov.io/gh/keplersj/jest-serializer-json-ld-script/branch/master/graph/badge.svg)](https://codecov.io/gh/keplersj/jest-serializer-json-ld-script)
[![Mentioned in Awesome Jest](https://awesome.re/mentioned-badge.svg)](https://github.com/jest-community/awesome-jest)Jest Snapshot serializer to better visualize React `` elements containing LD+JSON data.
## Installation
Install preset using npm:
```shell
npm install --save-dev jest-serializer-json-ld-script
```or yarn:
```shell
yarn add --dev jest-serializer-json-ld-script
```## Usage
Configure Jest to use the serializer in `jest.config.js`:
```js
module.exports = {
snapshotSerializers: ["jest-serializer-json-ld-script"]
};
```or `package.json`:
```json
{
"jest": {
"snapshotSerializers": ["jest-serializer-json-ld-script"]
}
}
```## Related Packages
- [`jest-runner-prettier`](https://github.com/keplersj/jest-runner-prettier) - Use Jest to check your codebase against `prettier`
- [`jest-preset-gatsby`](https://github.com/keplersj/jest-preset-gatsby) - Jest preset to ease unit testing a Gatsby project
- [`jest-serializer-react-helmet`](https://github.com/keplersj/jest-serializer-react-helmet) - Jest snapshot serializer to include React Helmet side effects in snapshots
- [`jest-raw-loader`](https://github.com/keplersj/jest-raw-loader) - Load the raw content of files in Jest, replicating the behavior of `webpack`'s `raw-loader`## License
Copyright 2019 Kepler Sticka-Jones. Licensed ISC