排毒测试无法运行:无法读取未定义的属性(读取' testenvironmentoptions')

发布于 2025-02-11 06:09:20 字数 1206 浏览 2 评论 0原文

我一直在尝试在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

童话 2025-02-18 06:09:20

用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.

寄人书 2025-02-18 06:09:20

也许您需要拥有相同的版本,可以使用纱线安装或NPM安装尝试此命令

maybe you need to have same version you can try this command with yarn install or npm install

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文