nextgenas-test: automated testing for transpiled ActionScript
Hi, ActionScript community!

Automated testing makes your life as a developer easier because you get quick feedback if you change some code and accidentally break something that was working previously. I know I'm more confident in the stability of my code when I see that the 1000+ tests in one of my libraries are still passing after I make some big changes.

I recently looked at options for testing transpiled ActionScript. I gave FlexUnit a try, but it clearly has deep dependencies on Adobe Flash Player.  With some work, it could probably be refactored, but I need to write some tests sooner rather than later. I tried using dts2as to expose some JavaScript testing libraries to ActionScript, but they tend to use JavaScript patterns that don't feel quite right. Lots of anonymous functions and things like that. While JavaScript and ActionScript come from the same lineage, they are just different enough that certain patterns don't always translate well.

That's why I created nextgenas-test. I wanted something a bit more like FlexUnit, where tests are defined as methods on classes, with [Test], [Before], and [After] metadata that can be detected with reflection APIs.

https://github.com/BowlerHatLLC/nextgenas-test

You can see the example of a simple test in the image at the top of this post.

Both asconfigc and nextgenas-test have tests written with nextgenas-test (yes, it tests itself!), and I plan to continue testing future projects with this library. I hope you'll give it a try and share some feedback. Thanks!

Happy coding!

Josh Tynjala
NextGen ActionScript