Created
May 27, 2015 14:14
-
-
Save piuccio/8cc357b9ec7e248b5b68 to your computer and use it in GitHub Desktop.
karma-jspm load only some tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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