Skip to content
Snippets Groups Projects
Unverified Commit 4877cd05 authored by John Molakvoæ's avatar John Molakvoæ Committed by Morris Jobke
Browse files

Bump karma config

parent 8d3f58c3
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
"jsdoc": "~3.5.5", "jsdoc": "~3.5.5",
"karma": "^2.0.2", "karma": "^2.0.2",
"karma-coverage": "*", "karma-coverage": "*",
"karma-jasmine": "^1.1.0", "karma-jasmine": "^1.1.2",
"karma-jasmine-sinon": "^1.0.4", "karma-jasmine-sinon": "^1.0.4",
"karma-junit-reporter": "*", "karma-junit-reporter": "^1.2.0",
"karma-phantomjs-launcher": "*", "karma-phantomjs-launcher": "^1.0.4",
"karma-viewport": "^1.0.2", "karma-viewport": "^1.0.2",
"phantomjs-prebuilt": "*",
"node-sass": "~4.9.0", "node-sass": "~4.9.0",
"phantomjs-prebuilt": "*",
"sinon": "<= 5.0.7" "sinon": "<= 5.0.7"
}, },
"engine": "node >= 6.9" "engine": "node >= 6.9"
......
/** /**
* ownCloud * ownCloud
* *
* @author Vincent Petry * @author Vincent Petry
* @copyright 2014 Vincent Petry <pvince81@owncloud.com> * @copyright 2014 Vincent Petry <pvince81@owncloud.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 3 of the License, or any later version. * version 3 of the License, or any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
* *
* You should have received a copy of the GNU Affero General Public * You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
/** /**
* This node module is run by the karma executable to specify its configuration. * This node module is run by the karma executable to specify its configuration.
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
/* jshint node: true */ /* jshint node: true */
module.exports = function(config) { module.exports = function(config) {
function findApps() { function findApps() {
/* /*
var fs = require('fs'); var fs = require('fs');
...@@ -115,12 +114,7 @@ module.exports = function(config) { ...@@ -115,12 +114,7 @@ module.exports = function(config) {
name: 'settings', name: 'settings',
srcFiles: [ srcFiles: [
'settings/js/apps.js', 'settings/js/apps.js',
'settings/js/users/deleteHandler.js',
'core/vendor/marked/marked.min.js' 'core/vendor/marked/marked.min.js'
],
testFiles: [
'settings/tests/js/appsSpec.js',
'settings/tests/js/users/deleteHandlerSpec.js'
] ]
} }
]; ];
...@@ -130,14 +124,16 @@ module.exports = function(config) { ...@@ -130,14 +124,16 @@ module.exports = function(config) {
// it is useful to disable coverage for debugging // it is useful to disable coverage for debugging
// because the coverage preprocessor will wrap the JS files somehow // because the coverage preprocessor will wrap the JS files somehow
var enableCoverage = !parseInt(process.env.NOCOVERAGE, 10); var enableCoverage = !parseInt(process.env.NOCOVERAGE, 10);
console.log('Coverage preprocessor: ', enableCoverage?'enabled':'disabled'); console.log(
'Coverage preprocessor: ',
enableCoverage ? 'enabled' : 'disabled'
);
// default apps to test when none is specified (TODO: read from filesystem ?) // default apps to test when none is specified (TODO: read from filesystem ?)
var appsToTest = process.env.KARMA_TESTSUITE; var appsToTest = process.env.KARMA_TESTSUITE;
if (appsToTest) { if (appsToTest) {
appsToTest = appsToTest.split(' '); appsToTest = appsToTest.split(' ');
} } else {
else {
appsToTest = ['core'].concat(findApps()); appsToTest = ['core'].concat(findApps());
} }
...@@ -167,19 +163,19 @@ module.exports = function(config) { ...@@ -167,19 +163,19 @@ module.exports = function(config) {
var srcFile, i; var srcFile, i;
// add vendor library files // add vendor library files
for ( i = 0; i < coreModule.vendor.length; i++ ) { for (i = 0; i < coreModule.vendor.length; i++) {
srcFile = vendorPath + coreModule.vendor[i]; srcFile = vendorPath + coreModule.vendor[i];
files.push(srcFile); files.push(srcFile);
} }
// add core library files // add core library files
for ( i = 0; i < coreModule.libraries.length; i++ ) { for (i = 0; i < coreModule.libraries.length; i++) {
srcFile = corePath + coreModule.libraries[i]; srcFile = corePath + coreModule.libraries[i];
files.push(srcFile); files.push(srcFile);
} }
// add core modules files // add core modules files
for ( i = 0; i < coreModule.modules.length; i++ ) { for (i = 0; i < coreModule.modules.length; i++) {
srcFile = corePath + coreModule.modules[i]; srcFile = corePath + coreModule.modules[i];
files.push(srcFile); files.push(srcFile);
if (enableCoverage) { if (enableCoverage) {
...@@ -197,7 +193,7 @@ module.exports = function(config) { ...@@ -197,7 +193,7 @@ module.exports = function(config) {
function addApp(app) { function addApp(app) {
// if only a string was specified, expand to structure // if only a string was specified, expand to structure
if (typeof(app) === 'string') { if (typeof app === 'string') {
app = { app = {
srcFiles: 'apps/' + app + '/js/**/*.js', srcFiles: 'apps/' + app + '/js/**/*.js',
testFiles: 'apps/' + app + '/tests/js/**/*.js' testFiles: 'apps/' + app + '/tests/js/**/*.js'
...@@ -217,23 +213,47 @@ module.exports = function(config) { ...@@ -217,23 +213,47 @@ module.exports = function(config) {
} }
// add source files for apps to test // add source files for apps to test
for ( i = 0; i < appsToTest.length; i++ ) { for (i = 0; i < appsToTest.length; i++) {
addApp(appsToTest[i]); addApp(appsToTest[i]);
} }
// serve images to avoid warnings // serve images to avoid warnings
files.push({pattern: 'core/img/**/*', watched: false, included: false, served: true}); files.push({
files.push({pattern: 'core/css/images/*', watched: false, included: false, served: true}); pattern: 'core/img/**/*',
watched: false,
included: false,
served: true
});
files.push({
pattern: 'core/css/images/*',
watched: false,
included: false,
served: true
});
// include core CSS // include core CSS
files.push({pattern: 'core/css/*.css', watched: true, included: true, served: true}); files.push({
files.push({pattern: 'tests/css/*.css', watched: true, included: true, served: true}); pattern: 'core/css/*.css',
watched: true,
included: true,
served: true
});
files.push({
pattern: 'tests/css/*.css',
watched: true,
included: true,
served: true
});
// Allow fonts // Allow fonts
files.push({pattern: 'core/fonts/*', watched: false, included: false, served: true}); files.push({
pattern: 'core/fonts/*',
watched: false,
included: false,
served: true
});
config.set({ config.set({
// base path, that will be used to resolve files and exclude // base path, that will be used to resolve files and exclude
basePath: '..', basePath: '..',
...@@ -244,9 +264,7 @@ module.exports = function(config) { ...@@ -244,9 +264,7 @@ module.exports = function(config) {
files: files, files: files,
// list of files to exclude // list of files to exclude
exclude: [ exclude: [],
],
proxies: { proxies: {
// prevent warnings for images // prevent warnings for images
...@@ -271,7 +289,7 @@ module.exports = function(config) { ...@@ -271,7 +289,7 @@ module.exports = function(config) {
preprocessors: preprocessors, preprocessors: preprocessors,
coverageReporter: { coverageReporter: {
dir:'tests/karma-coverage', dir: 'tests/karma-coverage',
reporters: [ reporters: [
{ type: 'html' }, { type: 'html' },
{ type: 'cobertura' }, { type: 'cobertura' },
...@@ -282,7 +300,6 @@ module.exports = function(config) { ...@@ -282,7 +300,6 @@ module.exports = function(config) {
// enable / disable colors in the output (reporters and logs) // enable / disable colors in the output (reporters and logs)
colors: true, colors: true,
// level of logging // level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
...@@ -298,13 +315,30 @@ module.exports = function(config) { ...@@ -298,13 +315,30 @@ module.exports = function(config) {
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`) // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
// - PhantomJS // - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
// use PhantomJS_debug for extra local debug
browsers: ['PhantomJS'], browsers: ['PhantomJS'],
plugins: [
'karma-phantomjs-launcher',
'karma-coverage',
'karma-jasmine',
'karma-jasmine-sinon',
'karma-viewport',
'karma-junit-reporter'
],
// you can define custom flags
customLaunchers: {
PhantomJS_debug: {
base: 'PhantomJS',
debug: true
}
},
// If browser does not capture in given timeout [ms], kill it // If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000, captureTimeout: 60000,
// Continuous Integration mode // Continuous Integration mode
// if true, it capture browsers, run tests and exit // if true, it capture browsers, run tests and exit
singleRun: false singleRun: false
}); });
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment