{"id":16231638,"url":"https://github.com/hustcc/react-testing-demo","last_synced_at":"2025-03-19T14:30:44.135Z","repository":{"id":44918051,"uuid":"88686246","full_name":"hustcc/react-testing-demo","owner":"hustcc","description":":checkered_flag: Ensure code quality of React components with jest, enzyme, jsdom, eslint.","archived":false,"fork":false,"pushed_at":"2024-06-18T02:41:42.000Z","size":11,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T19:12:00.149Z","etag":null,"topics":["enzyme","eslint","jest","jsdom","react","react-component","react-test","testing"],"latest_commit_sha":null,"homepage":"https://github.com/hustcc/react-testing-demo","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hustcc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-19T01:25:27.000Z","updated_at":"2023-03-08T03:59:55.000Z","dependencies_parsed_at":"2024-10-27T20:36:43.927Z","dependency_job_id":"04feb326-9e21-47fd-b1b4-84e17df03c29","html_url":"https://github.com/hustcc/react-testing-demo","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"9a7c396c47e81a051ee7f7b17b4e7c68d7477422"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Freact-testing-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Freact-testing-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Freact-testing-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Freact-testing-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcc","download_url":"https://codeload.github.com/hustcc/react-testing-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997041,"owners_count":20380980,"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":["enzyme","eslint","jest","jsdom","react","react-component","react-test","testing"],"created_at":"2024-10-10T13:06:22.854Z","updated_at":"2025-03-19T14:30:43.806Z","avatar_url":"https://github.com/hustcc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-testing-demo\n\n\u003e Some simple code / demo about how to to test in React with `jest` + `enzyme` + `eslint`.\n\n[![Build Status](https://travis-ci.org/hustcc/react-testing-demo.svg?branch=master)](https://travis-ci.org/hustcc/react-testing-demo)\n\n\n## 1. About test\n\n - E2E test: 10%\n - Integration test: 20%\n - Unit test: 70%\n\n## 2. Introduce\n\n1. test01 ~ test04: **jest**, test logical module.\n2. test05: **jest** + **enzyme**, test react component with assert.\n3. test06: **jest**, test react component with snapshots.\n4. test07: **jest** + **jsdom**, test react component, and mock the document function in `setupFiles`.\n\n\n## 3. Run\n\n```sh\ngit clone git@github.com:hustcc/react-testing-demo.git\n\ncd react-testing-demo\n\nnpm i \n\nnpm test\n```\n\n\n## 4. Read\n\n1. [聊一聊前端自动化测试](https://github.com/tmallfe/tmallfe.github.io/issues/37)\n2. [从工程化角度讨论如何快速构建可靠 React 组件](https://github.com/lcxfs1991/blog/issues/18?hmsr=toutiao.io\u0026utm_medium=toutiao.io\u0026utm_source=toutiao.io)\n3. [How React Components Make UI Testing Easy](https://www.toptal.com/react/how-react-components-make-ui-testing-easy)\n4. [jest API documents](http://facebook.github.io/jest/docs/api.html)\n5. [enzyme API documents](https://github.com/airbnb/enzyme/blob/master/docs/api)\n6. [使用 Jest + Enzyme 测试 React 应用](https://www.atatech.org/articles/74344)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Freact-testing-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcc%2Freact-testing-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Freact-testing-demo/lists"}