首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >TypeError:当Jest测试包含rappid.js的角组件时,无法读取未定义的属性(读取“原型”)

TypeError:当Jest测试包含rappid.js的角组件时,无法读取未定义的属性(读取“原型”)
EN

Stack Overflow用户
提问于 2022-02-25 08:15:06
回答 1查看 259关注 0票数 1

用rappid面对same错误。我尝试了建议的解决方案,但仍然面临同样的错误。

代码语言:javascript
运行
复制
  ● Test suite failed to run

TypeError: Cannot read properties of undefined (reading 'prototype')

  12 |  or from the Rappid archive as was distributed by client IO. See the LICENSE file.*/
  13 | /* eslint-disable */
> 14 | import { dia, shapes, ui } from '@clientio/rappid';
     | ^
  15 |
  16 | import { enableVirtualRendering } from './features/virtual-rendering';
  17 | import { toolbarConfig } from './config/toolbar.config';

  at ../../node_modules/@clientio/rappid/rappid.js:4070:32
  at ../../node_modules/@clientio/rappid/rappid.js:4613:3
  at ../../node_modules/@clientio/rappid/rappid.js:2:65

错误在rappid.js中的应用

有人能帮我一下吗。为了纠正这一点我错过了什么。

EN

回答 1

Stack Overflow用户

发布于 2022-05-23 08:39:04

Jest使用不支持某些SVG实现的jsdom。https://github.com/jsdom/jsdom/issues/918

在Jest中模拟缺少的方法是可能的。

下面的存储库包含带有JointJS的Jest模拟。这是一个反应项目,但类似的测试设置角应该也解决了这个问题,我认为。https://github.com/clientIO/rappid-tutorial-react/blob/main/src/setupTests.ts

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71262897

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档