enzyme-to-json
- Version 3.6.2
- Published
- 65.7 kB
- 3 dependencies
- MIT license
Install
npm i enzyme-to-json
yarn add enzyme-to-json
pnpm add enzyme-to-json
Overview
convert enzyme wrapper to a format compatible with Jest snapshot
Index
Functions
function createSerializer
createSerializer: (options?: Options) => JestSerializer;
createSerializer helper is used to create snapshot serializers for Jest
Parameter options
an option object which accepts
map
,noKey
andmode
as keys
function mountToJson
mountToJson: { (wrapper: ReactWrapper, options?: Options): Json; <P, S>(wrapper: ReactWrapper<P, S>, options?: Options): Json;};
mountToJson helper is used to convert Enzyme mount wrappers to a format compatible with Jest snapshot
Parameter wrapper
an Enzyme mount wrapper
Parameter options
an option object which accepts
map
,noKey
andmode
as keys
function renderToJson
renderToJson: (wrapper: cheerio.Cheerio, options?: Options) => Json;
renderToJson helper is used to convert Enzyme render wrappers to a format compatible with Jest snapshot
Parameter wrapper
an Enzyme render wrapper
Parameter options
an option object which accepts
map
,noKey
andmode
as keys
function shallowToJson
shallowToJson: { (wrapper: ShallowWrapper, options?: Options): Json; <P, S>(wrapper: ShallowWrapper<P, S>, options?: Options): Json;};
shallowToJson helper is used to convert Enzyme shallow wrappers to a format compatible with Jest snapshot
Parameter wrapper
an Enzyme shallow wrapper
Parameter options
an option object which accepts
map
,noKey
andmode
as keys
function toJson
toJson: { (wrapper: CommonWrapper | cheerio.Cheerio, options?: Options): Json; <P, S>(wrapper: any, options?: Options): Json;};
toJson helper is used to convert any Enzyme wrapper to a format compatible with Jest snapshot
Parameter wrapper
any Enzyme wrapper
Parameter options
an option object which accepts
map
,noKey
andmode
as keys
Interfaces
interface JestSerializer
interface JestSerializer {}
interface Json
interface Json {}
interface Options
interface Options {}
property ignoreDefaultProps
ignoreDefaultProps?: boolean;
property map
map?: OutputMapper;
property mode
mode?: 'shallow' | 'deep';
property noKey
noKey?: boolean;
interface OutputMapper
interface OutputMapper {}
call signature
(json: Json): Json;
Package Files (1)
Dependencies (3)
Dev Dependencies (25)
- @babel/cli
- @babel/core
- @babel/preset-env
- @babel/preset-react
- babel-jest
- codecov
- enzyme
- enzyme-adapter-react-16
- eslint
- eslint-config-prettier
- eslint-config-standard
- eslint-config-standard-react
- eslint-plugin-import
- eslint-plugin-node
- eslint-plugin-promise
- eslint-plugin-react
- eslint-plugin-standard
- jest
- prettier
- prettier-check
- prop-types
- raf
- react
- react-dom
- react-test-renderer
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/enzyme-to-json
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/enzyme-to-json)
- HTML<a href="https://www.jsdocs.io/package/enzyme-to-json"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3790 ms. - Missing or incorrect documentation? Open an issue for this package.