我应该从头开始对反应本机项目使用jest或jest-cli吗?

时间:2017-12-10 21:31:06

标签: node.js reactjs react-native jest

从头开始创建反应原生项目时,我在jest获得devDependencies并测试通过!

但现在我在做测试时得到了:

(node:32629) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot find module '.../node_modules/jest-cli'
(node:32629) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我应该使用jest还是jest-cli?

1 个答案:

答案 0 :(得分:1)

如果没有更多信息,很难知道,但全球安装的library(data.table) dt2 <- dt[, .(STARTDATE, ENDDATE, ID, DAILY = seq(STARTDATE, ENDDATE, by = 1)), by = 1:nrow(dt)][, nrow := NULL] print(dt2[]) # STARTDATE ENDDATE ID DAILY # 1: 2011-10-10 2011-10-12 1 2011-10-10 # 2: 2011-10-10 2011-10-12 1 2011-10-11 # 3: 2011-10-10 2011-10-12 1 2011-10-12 # 4: 2011-10-13 2011-10-15 1 2011-10-13 # 5: 2011-10-13 2011-10-15 1 2011-10-14 # 6: 2011-10-13 2011-10-15 1 2011-10-15 # 7: 2011-10-10 2011-10-12 2 2011-10-10 # 8: 2011-10-10 2011-10-12 2 2011-10-11 # 9: 2011-10-10 2011-10-12 2 2011-10-12 # 10: 2011-10-13 2011-10-15 2 2011-10-13 # 11: 2011-10-13 2011-10-15 2 2011-10-14 # 12: 2011-10-13 2011-10-15 2 2011-10-15 可能比您的jest版本早。

尝试从项目目录中运行以下内容并比较结果:

packages.json

同时尝试运行jest --version npm exec jest --version ,因为它将使用您本地安装的版本运行jest。