preact-render-to-json
Advanced tools
Comparing version
@@ -109,3 +109,7 @@ (function (global, factory) { | ||
if (attributes) { | ||
ret.props = omit(attributes, ['key', 'children']); | ||
ret.props = omit(attributes, ['key', 'children', 'className']); | ||
if (attributes.className && !attributes.class) { | ||
ret.props.class = attributes.className; | ||
} | ||
} | ||
@@ -112,0 +116,0 @@ |
{ | ||
"name": "preact-render-to-json", | ||
"amdName": "preactRenderToJSON", | ||
"version": "3.6.5", | ||
"version": "3.6.6", | ||
"description": "Render JSX and Preact components to JSON", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
# preact-render-to-json | ||
[](https://www.npmjs.com/package/preact-render-to-json) | ||
[](https://circleci.com/gh/nathancahill/preact-render-to-json) | ||
Render JSX and [Preact] components to JSON. Useful for [Jest Snapshot testing]. | ||
@@ -16,4 +19,4 @@ | ||
test('component', () => { | ||
const tree = render(component) | ||
expect(tree).toMatchSnapshot() | ||
const tree = render(component) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
@@ -20,0 +23,0 @@ ``` |
@@ -97,3 +97,7 @@ import { falsey, assign, getNodeProps, omit } from './util'; | ||
if (attributes) { | ||
ret.props = omit(attributes, ['key', 'children']); | ||
ret.props = omit(attributes, ['key', 'children', 'className']); | ||
if (attributes.className && !attributes.class) { | ||
ret.props.class = attributes.className; | ||
} | ||
} | ||
@@ -100,0 +104,0 @@ |
Sorry, the diff of this file is not supported yet
24788
6.66%14
7.69%334
8.09%30
11.11%