【问题标题】:Is Preact testing library same as React testing library in terms of the testing the components?在测试组件方面,Preact 测试库是否与 React 测试库相同?
【发布时间】:2021-09-25 13:39:04
【问题描述】:

来自 preact 的 documentation 提供了 preact-testing-library 是 preact/test-utils 的轻量级包装器的信息

来自 react 的 documentation 提供了 react-testing-library 是 react-dom 和 react-dom/test-utils 的轻量级包装器的信息

看起来它们都应该用于测试组件。我对吗?我是一个反应/预演新手,因此问题

【问题讨论】:

    标签: react-testing-library preact


    【解决方案1】:

    是的。没有“preact-dom”,因为 Preact 只针对 DOM,如果您对此感到困惑的话。

    两者都可以用来测试组件。

    【讨论】:

      猜你喜欢
      • 2019-05-17
      • 2021-11-09
      • 2021-05-26
      • 1970-01-01
      • 2021-04-17
      • 2021-05-08
      • 2021-02-20
      • 2019-04-07
      • 2021-07-03
      相关资源
      最近更新 更多