After hours of trying, I've managed to do this. It's pretty simple actually, I was just trying to reinvent the wheel, using LAB.js I was able to do it quite easily, this is inside your test.js
(and the result log is pretty nice too):
function run() {
describe("My code on jQuery " + ($().jquery), function () {
// do your thing
});
}
var
$versions = ['1.7.1','1.7.2','1.8.0','1.8.1','1.8.2','1.8.3','1.9.0','2.0.0b1'];
for (var i = 0; i < $versions.length; i++) {
$LAB
.setOptions({AlwaysPreserveOrder:true, AllowDuplicates:true, CacheBust:true, BasePath:'/test/'})
.script('tests/lib/jquery-' + ($versions[i]) + '.js')
.script('tests/lib/jasmine-jquery.js')
/* .script('any-other-lib.js') */
.wait(run);
}
Everything loaded in $LAB loads synchronously and in order, so you can always ensure the load order of the scripts. Pretty simple and with continuous integration, it can run in the background of the IDE without any hassle (unless sometimes the runner won't cleanup and will throw an exception saying $ is undefined
)