标签: jest-circus

排毒:App 没有响应下面的网络请求

使用 Jest-Circus 作为测试运行器运行 detox 17.4.3 我在使用 iOS 模拟器时遇到以下错误。

detox[18766] WARN:  [Client.js/PENDING_REQUESTS] App has not responded to the network requests below:
  (id = -1000) isReady: {}

Unresponded network requests might result in timeout errors in Detox tests.
Run Code Online (Sandbox Code Playgroud)

这是我的 package.json 中 Jest 的版本。

 "jest": "^26.4.1",

 "jest-circus": "^26.4.1",  
Run Code Online (Sandbox Code Playgroud)

任何想法如何进一步调试或修复?

jestjs detox jest-circus

5
推荐指数
1
解决办法
472
查看次数

在 testRunner 设置为 jest-circus 的情况下访问 jasmine 导致:ReferenceError: jasmine is not defined

默认情况下jest,您可以简单地jasmine全局访问。但是一旦你切换testRunnerjest-circus,jasmine是未定义的。以下是一个最小的、可重现的示例:

babel.config.js

module.exports = {
  presets: [["@babel/preset-env", { targets: { node: "current" } }]],
};
Run Code Online (Sandbox Code Playgroud)

茉莉花规范.js

it("check jasmine", () => {
  console.log(jasmine);
});
Run Code Online (Sandbox Code Playgroud)

开玩笑的配置文件

module.exports = {
  rootDir: ".",
  testRunner: "jest-circus/runner",
};
Run Code Online (Sandbox Code Playgroud)

包.json

{
  "name": "test-jest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "jest"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@babel/core": "^7.12.10",
    "@babel/preset-env": "^7.12.11",
    "babel-jest": "^26.6.3",
    "jest": "^26.6.3",
    "jest-circus": "^26.6.3"
  }
}
Run Code Online (Sandbox Code Playgroud)

运行此测试将导致以下输出:

$ npm test

> …
Run Code Online (Sandbox Code Playgroud)

javascript node.js jasmine jestjs jest-circus

2
推荐指数
2
解决办法
1329
查看次数

标签 统计

jest-circus ×2

jestjs ×2

detox ×1

jasmine ×1

javascript ×1

node.js ×1