Unit Testing HaXe JavaScript Project


Today I continued to progress on my Samsung Smart TV project with unit test implementation. My aim is to prepare smooth process for automated builds. First, I tought I would struggle with it much more but at the end it appeared that necessary tools already exists.

My first sreps led me to “Writing Unit Tests” article about resources available directly with HaXe, however it seemed that JavaScript testing was not available. The article also referenced MUnit a cross-platform haxe unit testing framework, which looked to have more capabilities.

Read the rest of this entry »

Quick Tip: FlexUnit & JUnitReport & haltonfailure

In case you are using flexunit ant task with your flex builds and you are used to failed builds with haltonfailure=”true”, you may notice that junitreport task is not executed when unit tests fails. Without having test reports, it does not give you much info about what went wrong. Fortunately, there is a solution using attribute failureproperty and fail ant task. Here is a quick ant build config to generate junitreport report for failed unit tests followed by build fail.

Read the rest of this entry »

Quick Tip: FlexUnit & ANT

Even if you have worked already with flexunit task in ant, it may not be obvious that there are 2 ways to execute it. First, you can compile runner.mxml to .swf prior to flexunit task or you can force flexunit task to generate/compile runner for you. Now lets have a look at pros and cons of those 2 solutions. Unfortunately it seems the flexunit ant task development has stopped sometime a year ago, and a few features are missing in order to call this task perfect, so it seems we are left in wild with what we have…

Read the rest of this entry »