{"id":15201669,"url":"https://github.com/moox/jsx-test-helpers","last_synced_at":"2025-10-02T17:30:42.622Z","repository":{"id":57286624,"uuid":"55767347","full_name":"MoOx/jsx-test-helpers","owner":"MoOx","description":null,"archived":true,"fork":false,"pushed_at":"2017-09-26T19:45:39.000Z","size":77,"stargazers_count":36,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T15:53:20.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoOx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-08T09:29:20.000Z","updated_at":"2023-10-12T05:43:03.000Z","dependencies_parsed_at":"2022-09-09T23:01:30.194Z","dependency_job_id":null,"html_url":"https://github.com/MoOx/jsx-test-helpers","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fjsx-test-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fjsx-test-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fjsx-test-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Fjsx-test-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoOx","download_url":"https://codeload.github.com/MoOx/jsx-test-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235025952,"owners_count":18924371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-28T03:20:44.942Z","updated_at":"2025-10-02T17:30:37.307Z","avatar_url":"https://github.com/MoOx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsx-test-helpers\n\n[![Unix Build status](https://img.shields.io/travis/MoOx/jsx-test-helpers/master.svg?branch=master\u0026label=unix%20build)](https://travis-ci.org/MoOx/jsx-test-helpers)\n[![Version](https://img.shields.io/npm/v/jsx-test-helpers.svg)](https://github.com/MoOx/jsx-test-helpers/blob/master/CHANGELOG.md)\n\n[![Repo on GitHub](https://img.shields.io/badge/repo-GitHub-3D76C2.svg)](https://github.com/MoOx/jsx-test-helpers)\n[![Repo on GitLab](https://img.shields.io/badge/repo-GitLab-6C488A.svg)](https://gitlab.com/MoOx/jsx-test-helpers)\n[![Repo on BitBucket](https://img.shields.io/badge/repo-BitBucket-1F5081.svg)](https://bitbucket.org/MoOx/jsx-test-helpers)\n\n\u003e Helpers to easily write tests for React component/JSX code\n\nThis package [is very small](src/index.js) and provide simple helpers to easily use [React shallow rendering](http://facebook.github.io/react/docs/test-utils.html#shallow-rendering) method in conjunction with [react-element-to-jsx-string](https://github.com/algolia/react-element-to-jsx-string) to write straightforward tests for React component.\n\n**⚠️ [Be sure to read the test file, which is annotated](src/__tests__/index.js) 😙.**\n\n## Installation\n\n```console\n$ npm install jsx-test-helpers\n```\n\n## Usage\n\n**⚠️ [Be sure to read the test file, which have more complete annotated examples](src/__tests__/index.js).**\n\nExample with [Jest](http://facebook.github.io/jest/):\n\n```js\nimport React from 'react';\nimport { noop, renderJSX, JSX } from 'jsx-test-helpers';\n\nimport FunctionalComponentToTest from '../your-component';\n\n// fixture\nfunction FakeComponent() {}\n\ntest('Can render \u0026 test a functional component', () =\u003e {\n  expected(renderJSX(\u003cFunctionalComponentToTest bool /\u003e)).toMatch(\n    JSX(\u003cFakeComponent fixedProp={'some-value'} bool /\u003e)\n  );\n});\n```\n\n---\n\n## CONTRIBUTING\n\n* ⇄ Pull/Merge requests and ★ Stars are always welcome.\n* For bugs and feature requests, please create an issue.\n* Pull/Merge requests must be accompanied by passing automated tests (`$ npm test`).\n\n## [CHANGELOG](CHANGELOG.md)\n\n## [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Fjsx-test-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoox%2Fjsx-test-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Fjsx-test-helpers/lists"}