What I found as a neat approach is to write the self-contained YUITest code in a separate file in a template directory (i.e. selectTest.yuit).
Then in my app code, I pass along a conditional template parameter that will include that
And that'll run the app as usual. Then if I append ?t=1, then my app will suck in the