From 341122a1111a43f310b737bbb8d215d703f4c508 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 25 Jan 2016 14:54:53 +0100 Subject: [PATCH] Fix for run extension tests with commonjs --- test/all.js | 13 ++++++------- test/mocha.opts | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test/all.js b/test/all.js index c99874d6a8b..263d7ca424a 100644 --- a/test/all.js +++ b/test/all.js @@ -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) { diff --git a/test/mocha.opts b/test/mocha.opts index df45eea48d0..901fe63ef69 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -2,4 +2,3 @@ --ui tdd --reporter dot test/all.js -extensions/**/test/*.test.js