如何将unittest作为“普通”Dart app运行

时间:2013-11-19 11:51:47

标签: unit-testing dart dart-editor

我正在尝试在实施之前编写测试。一切都好,直到我有“没有这样的方法”的例外。 在html配置中运行代码(useHtmlConfiguration())我几乎没有关于异常的信息:/。

问题:是否可以在配置中运行选定的测试“solo_test”,让我调试异常,如“正常运行”

1 个答案:

答案 0 :(得分:0)

你扔什么类型的例外?

如果要抛出String或Exception,在此提交进入unittest包之前,您将看不到任何堆栈跟踪。

https://code.google.com/p/dart/source/detail?r=30322

在此之前,请确保抛出Error的实例(或子类)。

对你:http://api.dartlang.org/docs/channels/stable/latest/dart_core/UnimplementedError.html

然后您将看到堆栈跟踪数据。