简体   繁体   English

dart测试dart:html而不加载dartium

[英]dart test dart:html without loading dartium

Is there any way to test a code with dart:html imported on it, without dartium being triggered. 有什么方法可以测试导入了dart:html的代码,而不会触发dartium。

I want to test HttpRequest to a JSON data and expected it to display it on terminal, and dart editor wants to open dartium EVERYTIME, which i think unnecessary. 我想将HttpRequest测试为JSON数据,并希望将其显示在终端上,并且Dart编辑器希望每次都打开dartium,我认为这是不必要的。

Dartium contains the browser hosted Dart VM, which the relevant browser DOM bindings. Dartium包含浏览器托管的Dart VM,与相关的浏览器DOM绑定。 When you run code that needs a browser DOM, such as dart:html, you will get Dartium running. 当您运行需要浏览器DOM的代码(例如dart:html)时,将使Dartium运行。

However, you can also use DumpRenderTree - which is a headless browser (ie, produces output to the console). 但是,您也可以使用DumpRenderTree-这是一种无头浏览器(即,将输出生成到控制台)。

Take a look at these post for more about DumpRenderTree and Dart: 看看这些帖子,了解有关DumpRenderTree和Dart的更多信息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM