【发布时间】:2020-10-04 15:34:24
【问题描述】:
我在 React 项目中使用 next.js 并使用 react-slick 滑块插件,它工作正常,但是当我尝试通过运行测试它时 - `TypeError: Cannot read property 'querySelectorAll' of null.
对于测试设置,我使用了this 配置。
TypeError: Cannot read property 'querySelectorAll' of null
16 |
17 | it('render with error param', () => {
> 18 | const tree: ReactTestRendererJSON = renderer.create(
| ^
19 | <Home />
20 | ).toJSON();
21 | });
搜索了很多,但没有得到任何解决方案。
【问题讨论】:
-
在 gatsby.js 测试中面临同样的问题。我也找不到问题所在。 ??????
-
有关于这个问题的更新吗?
标签: javascript typescript jestjs next.js react-slick