reactjs - react 测试错误

标签 reactjs unit-testing testing jestjs enzyme

我第一次尝试在 React 中运行一些测试,但我收到了一些错误,并且不知道这些是什么。

2018-05-30 16:47 node[3217] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2018-05-30 16:47 node[3217] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2018-05-30 16:47 node[3217] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Error watching file for changes: EMFILE
    at _errnoException (util.js:1022:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1359:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! isomorphic@2.6.0 test: `react-app-rewired test --env=jsdom`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the isomorphic@2.6.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/EcoSurvUser/.npm/_logs/2018-05-30T15_47_27_998Z-debug.log
Alessandros-MacBook-Pro-2:isomorphic_immutable_js EcoSurvUser$ 

最佳答案

See this Github issue .在命令行中运行 brew install watchman

关于reactjs - react 测试错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50608894/

相关文章:

unit-testing - 如何对 Hadoop Writable 进行单元测试

java - 使用 Java 在 Selenium WebDriver 中制作可执行文件

带有 @HostLinener 的 Angular Jest 测试指令 ('window:scroll' )

node.js - 使用数据库进行自动化测试

javascript - 以函数式风格编写 React 组件

java - Robolectric:在我的案例中运行处理程序的循环程序

node.js - karma 测试通过,但 npm 测试给出错误

javascript - 是否可以根据路由激活影响 html 标记的 css 类?

node.js - Axios 请求不适用于 React + Redux

javascript - 如何摆脱 Material UI 容器组件中的填充?