From 81254e0b27d931269defbf94269bb9bd82cca1ab Mon Sep 17 00:00:00 2001 From: Amos Haviv Date: Wed, 23 Apr 2014 20:44:19 +0300 Subject: [PATCH] Fixing Karma To Load Libraries Independently --- config/config.js | 2 +- config/express.js | 4 ++-- karma.conf.js | 2 +- public/modules/articles/config/articles.client.routes.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/config.js b/config/config.js index a0fb1128ad..f24be0ba62 100644 --- a/config/config.js +++ b/config/config.js @@ -55,7 +55,7 @@ module.exports.getGlobbedFiles = function(globPatterns, removeRoot) { * Get the modules JavaScript files */ module.exports.getJavaScriptAssets = function(includeTests) { - var output = this.getGlobbedFiles(this.assets.js, 'public/'); + var output = this.getGlobbedFiles(this.assets.lib.concat(this.assets.js), 'public/'); // To include tests if (includeTests) { diff --git a/config/express.js b/config/express.js index 4ad2719bb5..557c348e61 100755 --- a/config/express.js +++ b/config/express.js @@ -58,7 +58,7 @@ module.exports = function(db) { // Set views path and view engine app.set('view engine', 'html'); - app.set('views', config.root + '/app/views'); + app.set('views', './app/views'); // Environment dependent middleware if (process.env.NODE_ENV === 'development') { @@ -99,7 +99,7 @@ module.exports = function(db) { app.use(flash()); // Setting the app router and static folder - app.use(express.static(config.root + '/public')); + app.use(express.static(path.resolve('./public'))); // Globbing routing files config.getGlobbedFiles('./app/routes/**/*.js').forEach(function(routePath) { diff --git a/karma.conf.js b/karma.conf.js index 993b1fa41c..235db83936 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -12,7 +12,7 @@ module.exports = function(config) { frameworks: ['jasmine'], // List of files / patterns to load in the browser - files: applicationConfiguration.assets.js.concat(applicationConfiguration.assets.tests), + files: applicationConfiguration.assets.lib.concat(applicationConfiguration.assets.js, applicationConfiguration.assets.tests), // Test results reporter to use // Possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' diff --git a/public/modules/articles/config/articles.client.routes.js b/public/modules/articles/config/articles.client.routes.js index d719e46c83..1531a9a57c 100755 --- a/public/modules/articles/config/articles.client.routes.js +++ b/public/modules/articles/config/articles.client.routes.js @@ -12,7 +12,7 @@ angular.module('articles').config(['$stateProvider', state('createArticle', { url: '/articles/create', templateUrl: 'modules/articles/views/create-article.client.view.html' - }).ยง + }). state('viewArticle', { url: '/articles/:articleId', templateUrl: 'modules/articles/views/view-article.client.view.html'