使用 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)
任何想法如何进一步调试或修复?
默认情况下jest,您可以简单地jasmine全局访问。但是一旦你切换testRunner到jest-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)