排毒测试无法运行:无法读取未定义的属性(读取' testenvironmentoptions')
我一直在尝试在React Native应用程序上运行一些排毒测试。直到最近,这些测试一直在进行。现在我遇到了错误: 测试套件未能
TypeError: Cannot read properties of undefined (reading 'testEnvironmentOptions')
11 | // Can be safely removed, if you are content with the default value (=300000ms)
12 | this.initTimeout = 30000000;
> 13 |
| ^
14 | // This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
15 | // This is strictly optional.
16 | this.registerListeners({
at new NodeEnvironment (../node_modules/jest-environment-node/build/index.js:96:49)
at new DetoxCircusEnvironment (../node_modules/detox/runners/jest-circus/environment.js:27:5)
at CustomDetoxEnvironment._createSuperInternal (environment.js:13:311)
at new CustomDetoxEnvironment (environment.js:31:20)
at async TestScheduler.scheduleTests (../node_modules/@jest/core/build/TestScheduler.js:333:13)
at async runJest (../node_modules/@jest/core/build/runJest.js:404:19)
14:09:34.503 detox[115576] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
对如何解决此问题进行任何想法? 我已经尝试更新开玩笑,开玩笑和开玩笑的环境以及排毒本身。
I've been trying to run some detox tests on a react native app. These tests had been working up till recently. Now I am getting the error:
Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'testEnvironmentOptions')
11 | // Can be safely removed, if you are content with the default value (=300000ms)
12 | this.initTimeout = 30000000;
> 13 |
| ^
14 | // This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
15 | // This is strictly optional.
16 | this.registerListeners({
at new NodeEnvironment (../node_modules/jest-environment-node/build/index.js:96:49)
at new DetoxCircusEnvironment (../node_modules/detox/runners/jest-circus/environment.js:27:5)
at CustomDetoxEnvironment._createSuperInternal (environment.js:13:311)
at new CustomDetoxEnvironment (environment.js:31:20)
at async TestScheduler.scheduleTests (../node_modules/@jest/core/build/TestScheduler.js:333:13)
at async runJest (../node_modules/@jest/core/build/runJest.js:404:19)
14:09:34.503 detox[115576] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*
Any ideas on how to fix this?
I've tried updating jest, jest-expo, and jest-environment, as well as detox itself.
--maxWorkers 1 e2e
Any ideas on how to fix this?
I've tried updating jest, jest-expo, and jest-environment, as well as detox itself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
用Jest以同一版本解决所有图书馆解决了问题。使用
npm ls
将它们全部列出,并系统地确保每个版本都具有相同的版本。Making all libraries with jest in their name the same version solved the problem. use
npm ls
to list them all out, and systematically make sure each have the same version.也许您需要拥有相同的版本,可以使用纱线安装或NPM安装尝试此命令
maybe you need to have same version you can try this command with yarn install or npm install