Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including jsx-test-helpers with all npm packages installed. Try it out:

var jsxTestHelpers = require("jsx-test-helpers")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jsx-test-helpers v3.0.0

Helpers to easily write tests for React component/JSX code


Unix Build status Version

Repo on GitHub Repo on GitLab Repo on BitBucket

Helpers to easily write tests for React component/JSX code

This package is very small and provide simple helpers to easily use React shallow rendering method in conjunction with react-element-to-jsx-string to write straightforward tests for React component.

⚠️ Be sure to read the test file, which is annotated 😙.


$ npm install jsx-test-helpers


⚠️ Be sure to read the test file, which have more complete annotated examples.

Example with Jest:

import React from 'react';
import { noop, renderJSX, JSX } from 'jsx-test-helpers';

import FunctionalComponentToTest from '../your-component';

// fixture
function FakeComponent() {}

test('Can render & test a functional component', () => {
  expected(renderJSX(<FunctionalComponentToTest bool />)).toMatch(
    JSX(<FakeComponent fixedProp={'some-value'} bool />)


  • ⇄ Pull/Merge requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull/Merge requests must be accompanied by passing automated tests ($ npm test).




RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free