Jest没有运行 - 无限期挂起

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

我最初在创建反应应用程序时遇到了这个问题,所以我确实做了一个只是开玩笑的骨头:

  1. 创建了新目录
  2. 该目录中的yarn init
  3. 纱线添加是
  4. 创建了新文件sum.js: function sum(a, b) { return a + b; } module.exports = sum;
  5. 创建文件来测试上面的功能 const sum = require('./sum'); test('adds 1 + 2 = 3' , () => { expect(sum(1,2)).toBe(3); });
  6. 添加到package.json: "scripts": { "test": "jest" },

但是当我进行纱线测试时,我得到了这个:

terry@terry-sharewalker:~/myProjects/test-jest$ yarn jest
yarn run v1.13.0
$ /home/terry/myProjects/test-jest/node_modules/.bin/jest

那里没有任何事情发生。它只是挂起。从create-react-app运行测试也发生了同样的事情。 react-scripts测试会显示,然后什么也没有。

这是我得到的:

Jest "^24.5.0"
Ubuntu 16.04
yarn 1.13.0
watchman 4.9.0
node 10.15.3

我重新安装并升级了我能想到的一切,包括npm,node,watchman,linuxbrew,yarn。如果有人能帮助我,我会永远感激!

node.js jestjs ubuntu-16.04 create-react-app yarnpkg
2个回答
1
投票

我也遇到了同样的问题。可以修复更新或重新安装守望者brew uninstall watchmanbrew install watchman

更多细节可以在这里找到https://github.com/facebook/jest/issues/4529


0
投票

我不确定为什么会这样,但确实如此。我在我的系统上重新安装了一些全局包:

npm update npm -g(至6.9.0)

npm update -g  

此更新:parcel-bundler为1.12.3

更新的守望者:brew update watchman(至4.9.0)

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