Fix for run extension tests with commonjs

This commit is contained in:
Martin Aeschlimann 2016-01-25 14:54:53 +01:00
parent 0587f20cd7
commit 341122a111
2 changed files with 6 additions and 8 deletions

View file

@ -50,7 +50,7 @@ function loadClientTests(cb) {
return file.replace(/\.js$/, '');
});
// load all modules
// load all modules with the AMD loader
define(modules, function () {
cb(null);
}, cb);
@ -61,13 +61,12 @@ function loadPluginTests(cb) {
var root = path.join(path.dirname(__dirname), 'extensions');
glob(TEST_GLOB, { cwd: root }, function (err, files) {
// load modules with commonjs
var modules = files.map(function (file) {
return 'extensions/' + file.replace(/\.js$/, '');
return '../extensions/' + file.replace(/\.js$/, '');
});
define(modules, function() {
cb(null);
}, cb);
modules.forEach(require);
cb(null);
});
}
@ -142,7 +141,7 @@ function main() {
}));
} else {
loadTasks.push(loadClientTests);
//loadTasks.push(loadPluginTests);
loadTasks.push(loadPluginTests);
}
async.parallel(loadTasks, function (err) {

View file

@ -2,4 +2,3 @@
--ui tdd
--reporter dot
test/all.js
extensions/**/test/*.test.js