Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created December 2, 2013 18:54
Show Gist options
  • Save karlwestin/7754871 to your computer and use it in GitHub Desktop.
Save karlwestin/7754871 to your computer and use it in GitHub Desktop.
var tests = [];
for (var file in window.__karma__.files) {
if (window.__karma__.files.hasOwnProperty(file)) {
if (/\/base\/spec\/js\/v2\/.*\.js$/.test(file)) {
tests.push(file);
}
}
}
console.log("Running tests for");
console.log(tests);
requirejs.config({
// Karma serves files from '/base'
baseUrl: '/base/js',
shim: {
"lib/jquery" : {
"exports" : "jquery"
}
},
deps : ["lib/jquery"],
paths: {
"lib/jquery": "lib/jquery",
"jquery": "lib/jquery"
},
callback: function() {
require(tests, function(resolvedTests) {
$.when.apply($, arguments).done(function() {
window.__karma__.start();
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment