安装

yarn add @testing-library/react-hooks msw -D

使用

src下面新建一个文件夹__test__(双下划线)

传统的单元测试

传统的单元测试通常来测一个方法或者函数: