1

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");
}
ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
David Wolever
  • 148,955
  • 89
  • 346
  • 502

3 Answers3

2

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

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

Labriola
  • 86
  • 4
1

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.

Sophistifunk
  • 4,742
  • 4
  • 28
  • 37
  • I'm (pretty) sure I've got the `--keep-as3-metadata+=Test` because, if I take out the `[Test]` metadata, this test doesn't run (ie, my other tests run but this one does not). – David Wolever Feb 05 '10 at 05:18
1

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.

David Wolever
  • 148,955
  • 89
  • 346
  • 502