Skip to content

Instantly share code, notes, and snippets.

@piuccio piuccio/adapter.js
Created May 27, 2015

Embed
What would you like to do?
karma-jspm load only some tests
var filterTests = document.location.search.match(/[\?\&]test=[a-z-\.]+/gi).map(function (test) {
return (test.split('=')[1] + '.spec.js').toLowerCase();
}) || [];
var filterLoadedTests = filterTests.length ? function (spec) {
var found = false;
filterTests.forEach(function (test) {
found = found || spec.toLowerCase().indexOf(test) !== -1;
});
return found;
} : function () {
return true;
};
karma.config.jspm.resolvedModuleIDs = karma.config.jspm.resolvedModuleIDs.filter(filterLoadedTests);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.