Skip to content

Commit 5c64b1d

Browse files
thelgevoldfilipesilva
authored andcommitted
feat:(support unit tests in folders outside of app)
Close #952
1 parent 740805b commit 5c64b1d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

addon/ng2/blueprints/ng2/files/config/karma-test-shim.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ __karma__.loaded = function () {
66
};
77

88
var distPath = '/base/dist/';
9-
var appPath = distPath + 'app/';
9+
var appPaths = ['app']; //Add all valid source code folders here
1010

1111
function isJsFile(path) {
1212
return path.slice(-3) == '.js';
@@ -17,7 +17,10 @@ function isSpecFile(path) {
1717
}
1818

1919
function isAppFile(path) {
20-
return isJsFile(path) && (path.substr(0, appPath.length) == appPath);
20+
return isJsFile(path) && appPaths.some(function(appPath) {
21+
var fullAppPath = distPath + appPath + '/';
22+
return path.substr(0, fullAppPath.length) == fullAppPath;
23+
});
2124
}
2225

2326
var allSpecFiles = Object.keys(window.__karma__.files)

0 commit comments

Comments
 (0)