Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jest 单元测试 Uncaught [TypeError: this.viewport.getCTM is not a function] #3676

Closed
LemonYo opened this issue Jun 14, 2023 · 3 comments
Closed
Labels

Comments

@LemonYo
Copy link

LemonYo commented Jun 14, 2023

问题描述

我的组件基于 @antv/x6开发,在进行单元测试的 时候 会报错,请问如何解决

重现链接

重现步骤

预期行为

平台

  • 操作系统: [macOS]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • X6 版本: [2.11.1]

屏幕截图或视频(可选)

image

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Jun 14, 2023

👋 @LemonYo

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@x6-bot x6-bot bot added the bug label Jun 14, 2023
@NewByVector
Copy link
Contributor

x6 是基于 svg dom 的,jest 不能完全模拟浏览器环境,也就是没有一些浏览器 api,比如 viewport.getCTM。可以使用一些可以完全模拟浏览器 api 的测试框架或者直接使用无头浏览器进行测试。

@x6-bot
Copy link
Contributor

x6-bot bot commented Jul 3, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Jul 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants