Skip to content

The Command Line Reporter

BrianGenisio edited this page Apr 4, 2011 · 2 revisions

To use Jasmine-Flex with the command-line reporter instead of the visual reporter (only works on Mac right now), create a new Flex Air project. Download the JasmineFlex.swc file and put it in your libs folder.

Add your specs using the <script> blocks.

Hook the applicationComplete event and add the TrivialCommandLineReporter. Tell the reporter to exit the app when it is complete so your app is not sticking around.

Here is an example of what this might look like:

<fx:Script source="spec/SpecHelper.as" />
<fx:Script source="spec/PlayerSpec.as" />

<s:applicationComplete>
	jasmine.getEnv().addReporter(new TrivialCommandLineReporter(function() {exit()}));
	jasmine.getEnv().execute();
</s:applicationComplete>

Now, run your app from the command line. Your results will show up in red and green.

As you add new specs to your project, make sure to add spec <script> tags.