Overview of scripting options in IDM, AM and IG. For IDM, recommended using CommonJS pattern for JS.
Q: Is there any plan to make the different approaches toward scripting more consistent between the products?
A: There is a plan, but relatively little priority to execute it.
Q: How do we write unit tests for the scripts written in AM?
A: You can't.