FlexUnit4:[Test(expect=“Error”)] 没有捕获错误?

发布于 2024-08-19 23:50:11 字数 166 浏览 2 评论 0原文

以下代码产生失败的测试,而不是通过的测试(正如我所期望的):

[Test(expects="Error")]
public function someTest():void {
    throw Error("this test doesn't pass");
}

The following code produces a failed test, not a passing test (as I would expect):

[Test(expects="Error")]
public function someTest():void {
    throw Error("this test doesn't pass");
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

樱娆 2024-08-26 23:50:11

在旧版本中,它是 [Test(expected='')]

在新版本中,我们支持预期和预期,因为这对许多人来说是令人困惑的

In older versions it was [Test(expected='')]

In newer versions we support both expected and expects as this was confusing for many

ヅ她的身影、若隐若现 2024-08-26 23:50:11

确保您链接的是 FlexUnit 的发行版 SWC,或者如果您自己编译它,请确保您在项目属性的“其他编译器选项”框中使用 --keep-as3-metadata+=Test。

Make sure you're linking against the release SWC of FlexUnit, or if you're compiling it yourself, make sure you're using --keep-as3-metadata+=Test in the "additional compiler options" box in project properties.

有木有妳兜一样 2024-08-26 23:50:11

我认为问题可能是我使用的是旧版本的 FlexUnit4。我刚刚升级(到 4.0 RC1),它现在似乎可以工作了。

I think the problem may have been that I was using an older version of FlexUnit4. I just upgraded (to 4.0 RC1) and it seems to be working now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文