---
title: "Discussion on \"测试 React 应用\" | Hashnode"
description: "Discussion on \"测试 React 应用\". 使用 create-react-app\n除了 Jest 之外，我们还需要另一个测试库，它将帮助我们以测试目的渲染组件。 \n目前最好的选择是react-testing-library ，这个库在最近几年迅速流行起来。\nnpm install --save-dev @testing-library/react @testing-library/jest-dom\n\n依赖项\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.14.1\",\n ..."
url: "https://hashnode.com/posts/react/626241f3d82f4558aff86c9a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [测试 React 应用](https://lihua.hashnode.dev/react?utm_source=hashnode&utm_medium=feed)

使用 create-react-app 除了 Jest 之外，我们还需要另一个测试库，它将帮助我们以测试目的渲染组件。 目前最好的选择是react-testing-library ，这个库在最近几年迅速流行起来。 npm install --save-dev @testing-library/react @testing-library/jest-dom 依赖项 "dependencies": { "@testing-library/jest-dom": "^5.14.1", ...

Apr 22, 2022 · 1 min read · lihua.hashnode.dev  
Read the article

-   [#unit-testing](https://hashnode.com/tag/unit-testing)

## Written by

[Xin shen](https://hashnode.com/@lihua)

@lihua · China Beijing

  
[View profile](https://hashnode.com/@lihua)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
