单元测试 Monaco 编辑器仅呈现第一行。

huangapple go评论59阅读模式
英文:

Unit testing monaco editor renders only first line

问题

我正在使用vite+vitest进行我的项目。我安装了vitest-canvas-mock,并成功运行了测试。但它只呈现代码中的第一行。我无法添加文本或看到任何其他功能。

有人找到了如何编写涉及monaco-editor的适当单元测试吗?

我们在monaco-editor中投入了大量资源,能够编写单元测试将会很有益。

英文:

I am using vite+vitest for my project. I installed vitest-canvas-mock and its successful in running the tests.
But it is rendering only the first line in the code. I am not able to add text or see any other features.

Did anyone figure out how to write proper unit tests involving monaco-editor.

We are heavily invested in monaco-editor and it would be good to be able to write unit tests.

答案1

得分: 1

Monaco-editor 仅渲染所需的内容以填充可用空间。请确保您的模拟 DOM 具有足够的垂直空间来渲染更多行。

英文:

Monaco-editor only renders as much as is needed to fill the available space. Make sure you have enough vertical space in your mock DOM to render more lines.

huangapple
  • 本文由 发表于 2023年2月14日 19:34:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75447247.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定