菜单

本页面中的信息并不完全以您的首选语言展示,我们正在完善其他语言版本。想要以您的首选语言了解相关信息,可以点击这里下载PDF。

语言 & 框架

React Testing Library

Nov 2019
试验?

JavaScript世界日新月异,随着我们在框架使用方面的经验越来越多,我们的推荐也随之改变。有些框架随着我们的深入使用,会使其他类似框架都黯然失色。在React前端测试方面,React Testing Library就是这样一个例子。用它写的测试比其他框架(如Enzyme)脆弱,因为它鼓励独立测试组件间的关系,而不是测试全部实现细节。

Apr 2019
评估?

As the pace of change in JavaScript frameworks has slowed, our teams have more time to work with specific frameworks and are gaining deeper insights as a result. With React and the dominant testing framework, Enzyme, we've observed a worrying trend of unit tests becoming tightly coupled to implementation details without providing — because the focus is on shallow details — much confidence that features work as expected. These unit tests make evolving the design difficult and they shift too much responsibility up the test pyramid to functional testing. This has made us revisit the idea of subcutaneous testing. Additionally, because of its design, Enzyme has issues trying to keep up with React's development. All this has pushed us toward assessing react-testing-library as a new framework for testing React applications.