Skip to content

Commit

Permalink
Merge "JSCS cleanup - style guide cleanup for karma.config.js files"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jun 25, 2015
2 parents f1779d8 + 7033531 commit 94542b6
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 38 deletions.
53 changes: 34 additions & 19 deletions horizon/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
/*
* (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

var fs = require('fs');
var path = require('path');

module.exports = function(config) {
module.exports = function (config) {
var xstaticPath;
var basePaths = [
'./.venv',
'./.tox/py27'
]
];

for (var i = 0; i < basePaths.length; i++) {
var basePath = path.resolve(basePaths[i]);
Expand All @@ -19,18 +36,17 @@ module.exports = function(config) {
}

if (!xstaticPath) {
console.error("xStatic libraries not found, please set up venv");
console.error('xStatic libraries not found, please set up venv');
process.exit(1);
}

config.set({

preprocessors: {
// Used to collect templates for preprocessing.
// NOTE: the templates must also be listed in the files section below.
'./**/*.html': ['ng-html2js'],
// Used to indicate files requiring coverage reports.
'./**/!(*spec).js': ['coverage']
'./**/!(*.spec).js': ['coverage']
},

// Sets up module to process templates.
Expand All @@ -40,14 +56,15 @@ module.exports = function(config) {
},

// Assumes you're in the top-level horizon directory.
basePath : './static/',
basePath: './static/',

// Contains both source and test files.
files : [

// shim, partly stolen from /i18n/js/horizon/
// Contains expected items not provided elsewhere (dynamically by
// Django or via jasmine template.
files: [
/*
* shim, partly stolen from /i18n/js/horizon/
* Contains expected items not provided elsewhere (dynamically by
* Django or via jasmine template.
*/
'../../test-shim.js',

// from jasmine.html
Expand Down Expand Up @@ -103,32 +120,30 @@ module.exports = function(config) {
'**/*.html'
],

autoWatch : true,
autoWatch: true,

frameworks: ['jasmine'],

browsers : ['PhantomJS'],
browsers: ['PhantomJS'],

phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered
// (useful if karma exits without killing phantom)
exitOnResourceError: true
},

reporters : [ 'progress', 'coverage' ],
reporters: ['progress', 'coverage'],

plugins : [
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage'
],

coverageReporter: {
type : 'html',
dir : '../.coverage-karma/'
type: 'html',
dir: '../.coverage-karma/'
}

});
};

53 changes: 34 additions & 19 deletions openstack_dashboard/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
/*
* (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

var fs = require('fs');
var path = require('path');

module.exports = function(config) {
module.exports = function (config) {
var xstaticPath;
var basePaths = [
'./.venv',
'./.tox/py27'
]
];

for (var i = 0; i < basePaths.length; i++) {
var basePath = path.resolve(basePaths[i]);
Expand All @@ -19,18 +36,17 @@ module.exports = function(config) {
}

if (!xstaticPath) {
console.error("xStatic libraries not found, please set up venv");
console.error('xStatic libraries not found, please set up venv');
process.exit(1);
}

config.set({

preprocessors: {
// Used to collect templates for preprocessing.
// NOTE: the templates must also be listed in the files section below.
'./**/*.html': ['ng-html2js'],
// Used to indicate files requiring coverage reports.
'./**/!(*spec).js': ['coverage']
'./**/!(*.spec).js': ['coverage']
},

// Sets up module to process templates.
Expand All @@ -40,14 +56,15 @@ module.exports = function(config) {
},

// Assumes you're in the top-level horizon directory.
basePath : './static/',
basePath: './static/',

// Contains both source and test files.
files : [

// shim, partly stolen from /i18n/js/horizon/
// Contains expected items not provided elsewhere (dynamically by
// Django or via jasmine template.
files: [
/*
* shim, partly stolen from /i18n/js/horizon/
* Contains expected items not provided elsewhere (dynamically by
* Django or via jasmine template.
*/
'../../test-shim.js',

// from jasmine.html
Expand Down Expand Up @@ -103,32 +120,30 @@ module.exports = function(config) {
'**/*.html'
],

autoWatch : true,
autoWatch: true,

frameworks: ['jasmine'],

browsers : ['PhantomJS'],
browsers: ['PhantomJS'],

phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered
// (useful if karma exits without killing phantom)
exitOnResourceError: true
},

reporters : [ 'progress', 'coverage' ],
reporters: ['progress', 'coverage'],

plugins : [
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage'
],

coverageReporter: {
type : 'html',
dir : '../.coverage-karma/'
type: 'html',
dir: '../.coverage-karma/'
}

});
};

0 comments on commit 94542b6

Please sign in to comment.