angular-docs-cn/test-main.js
Tobias Bosch c8cf03f200 refactor: move rtts-assert into modules directory
The rtts assertion lib is only needed for js, 
but it should be treated like any other module (e.g. facade, …)
2014-09-26 17:36:57 -07:00

16 lines
395 B
JavaScript

var TEST_REGEXP = /^\/base\/modules\/[^\/]*\/test\/.*/;
Object.keys(window.__karma__.files).forEach(function(path) {
if (TEST_REGEXP.test(path)) {
var moduleName = path
.replace(/.*\/modules\//, '')
.replace(/\/src\//, '/')
.replace(/\/test\//, '/')
.replace(/\.\w*$/, '');
var mod = System.get(moduleName);
if (mod.main) {
mod.main();
}
}
});