小编Ren*_*Man的帖子

获取 Jest 错误 - TypeError:无法重新定义属性:性能

我正在一个 Expo 项目中工作,遇到一个问题,所有 Jest 测试都因以下原因而失败TypeError

\n
> Test run started at 5/2/2023, 12:02:30 PM <\n\n FAIL  app/utils/story-building-utils/getCurrentWeek.test.ts\n  \xe2\x97\x8f Test suite failed to run\n\n    TypeError: Cannot redefine property: performance\n\n      at Object.<anonymous> (node_modules/react-native/jest/setup.js:407:20)\n\n FAIL  app/utils/brainstorm-utils/__tests__/slugify.test.js\n  \xe2\x97\x8f Test suite failed to run\n\n    TypeError: Cannot redefine property: performance\n\n      at Object.<anonymous> (node_modules/react-native/jest/setup.js:407:20)\n\n FAIL  app/models/personas/personas.test.ts\n  \xe2\x97\x8f Test suite failed to run\n\n    TypeError: Cannot redefine property: performance\n\n      at Object.<anonymous> (node_modules/react-native/jest/setup.js:407:20)\n\n FAIL  app/models/brainstorms/brainstorms.test.ts\n  \xe2\x97\x8f Test suite failed to run\n\n    TypeError: Cannot redefine property: performance\n\n      at Object.<anonymous> …
Run Code Online (Sandbox Code Playgroud)

jestjs ts-jest

3
推荐指数
1
解决办法
3942
查看次数

标签 统计

jestjs ×1

ts-jest ×1