💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 通用测试框架 Jest [https://jestjs.io/docs/en/getting-started.html](https://jestjs.io/docs/en/getting-started.html) create-react-app 脚手架已经自带 Jest 和 react-testing-library # React Testing Library 目前版本的脚手架已自动安装。 ``` "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", ``` jest-dom 是 react testting library 的扩展插件:[https://github.com/testing-library/jest-dom](https://github.com/testing-library/jest-dom),这个脚手架也也会自动安装。其作用就是写测试代码时多了一些简便的方法。 # 模拟函数的调用 [https://jestjs.io/docs/en/mock-functions](https://jestjs.io/docs/en/mock-functions)