英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论