FlexUnit test sources

已回答

I'm trying to setup flex-unit and I have my sources and test sources folders marked properly. Inside of the tests folder is a class test class. SomeTest.as.

The problem is, my main application file to run the test has the following code

 

private function onCreationComplete():void
{
_testCore = new FlexUnitCore();
_testCore.addListener(TextListener.getDefaultTextListener(LogEventLevel.DEBUG));
_testCore.run(SomeTest);
}

But it can't resolve SomeTest. I have to mark the tests source as a normal sources root folder in order for it to work. How do I properly use the tests folder as an tests source?

0

If you use integrated FlexUnit support you do not need to write a custom test runner. You write a FooTest class with test methods like this

[Test]
public function testFoo():void { fail("unlucky"); }

and run it using right-click menu.

Some more info in help: https://www.jetbrains.com/help/idea/2017.1/testing-actionscript-and-flex-applications.html

0

We are using multiple different IDEs in our environment and eventually will be writing our own graphical test unit results component.

0

Ok, then placing your test runner inside a test source root sounds logical.

1

I really thought I had tried that and it didn't work and that's why I posted. But I just did it and it did work. Thanks for the magical words :)

 

Kyle

0

请先登录再写评论。