apache-flexactionscriptflexunitflexunit4

FlexUnit4: [Test(expect="Error")] doesn't catch errors?


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");
}

Solution

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

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