From 5e08d718a55f5532cddeba400d51dfc3f2f5a07c Mon Sep 17 00:00:00 2001 From: Torgeir Helgevold Date: Sat, 28 May 2016 22:24:40 -0400 Subject: [PATCH] feat:(support unit tests in folders outside of app) --- addon/ng2/blueprints/ng2/files/config/karma-test-shim.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addon/ng2/blueprints/ng2/files/config/karma-test-shim.js b/addon/ng2/blueprints/ng2/files/config/karma-test-shim.js index c1693a0baa95..05ffa152eb4d 100644 --- a/addon/ng2/blueprints/ng2/files/config/karma-test-shim.js +++ b/addon/ng2/blueprints/ng2/files/config/karma-test-shim.js @@ -6,7 +6,7 @@ __karma__.loaded = function () { }; var distPath = '/base/dist/'; -var appPath = distPath + 'app/'; +var appPaths = ['app']; //Add all valid source code folders here function isJsFile(path) { return path.slice(-3) == '.js'; @@ -17,7 +17,10 @@ function isSpecFile(path) { } function isAppFile(path) { - return isJsFile(path) && (path.substr(0, appPath.length) == appPath); + return isJsFile(path) && appPaths.some(function(appPath) { + var fullAppPath = distPath + appPath + '/'; + return path.substr(0, fullAppPath.length) == fullAppPath; + }); } var allSpecFiles = Object.keys(window.__karma__.files)