如何让我的测试在React Native App中运行?

时间:2018-03-10 22:38:27

标签: facebook react-native npm

我正在关注FB's getting started docs for React Native

一切都很好。它在世博会上运行,但是当我尝试测试时

    $ npm test

我收到以下错误,无法弄清楚如何进行简单的测试运行。

    > AwesomeProject@0.1.0 test /Users/Desktop/AwesomeProject
    > node node_modules/jest/bin/jest.js --watch

    2018-03-10 14:24 node[2805] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
    2018-03-10 14:24 node[2805] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
    2018-03-10 14:24 node[2805] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
    events.js:165
         throw er; // Unhandled 'error' event
         ^

    Error: Error watching file for changes: EMFILE
         at FSEvent.FSWatcher._handle.onchange (fs.js:1386:9)
    Emitted 'error' event at:
         at FSEvent.FSWatcher._handle.onchange (fs.js:1389:12)
    npm ERR! Test failed.  See above for more details.

1 个答案:

答案 0 :(得分:1)

我通过安装守望者(brew安装守望者)来解决这个问题