You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

preact-render-to-json

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

preact-render-to-json

Render JSX and Preact components to JSON


Version published
Weekly downloads
750
decreased by-8.09%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

preact-render-to-json

npm CircleCI

Render JSX and Preact components to JSON. Useful for Jest Snapshot testing.

Usage with Jest

import preact from 'preact'
import render from 'preact-render-to-json'

/** @jsx preact.h */

let component = <div class="foo">content</div>;

test('component', () => {
    const tree = render(component)
    expect(tree).toMatchSnapshot()
})

License

MIT

Keywords

FAQs

Package last updated on 18 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc