ReactJS测试-fsevents不是函数

问题描述 投票:0回答:1

我正在尝试为程序编写测试用例,并且听说了有关testing-library/reactjest-junit的好消息。我使用npm将两个软件包都安装到我的devDependencies中,并更改了我的测试脚本:"test": 'react-scripts test"当我运行npm test时,出现并提示[]

TypeError: fsevents is not a function

因此,我尝试对fsevents进行npm,但这没有帮助。我尝试在网上查找,但错误要么是fsevents不是构造函数,要么是更改为yarn。

是什么引起此问题?我正在使用npm v6.4.1和react-script v3.1.1

编辑:如果需要,也使用Mac

我正在尝试为我的程序编写测试用例,并且听说了有关test-library / react和jest-junit的好东西。我使用npm将两个软件包都安装到我的devDependencies中,并将脚本更改为...

reactjs unit-testing npm typeerror react-scripts
1个回答
0
投票

fsevents默认在Mac OS和Windows操作系统上与npm一起安装。错误"is not a constructor"可能意味着您试图在您的

© www.soinside.com 2019 - 2024. All rights reserved.