Browse Source

Bump karma config

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
pull/9982/head
John Molakvoæ (skjnldsv) 8 years ago
committed by Morris Jobke
parent
commit
4877cd050b
No known key found for this signature in database GPG Key ID: FE03C3A163FEDE68
  1. 7453
      build/package-lock.json
  2. 8
      build/package.json
  3. 74
      tests/karma.config.js

7453
build/package-lock.json
File diff suppressed because it is too large
View File

8
build/package.json

@ -18,13 +18,13 @@
"jsdoc": "~3.5.5",
"karma": "^2.0.2",
"karma-coverage": "*",
"karma-jasmine": "^1.1.0",
"karma-jasmine": "^1.1.2",
"karma-jasmine-sinon": "^1.0.4",
"karma-junit-reporter": "*",
"karma-phantomjs-launcher": "*",
"karma-junit-reporter": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-viewport": "^1.0.2",
"phantomjs-prebuilt": "*",
"node-sass": "~4.9.0",
"phantomjs-prebuilt": "*",
"sinon": "<= 5.0.7"
},
"engine": "node >= 6.9"

74
tests/karma.config.js

@ -35,7 +35,6 @@
/* jshint node: true */
module.exports = function(config) {
function findApps() {
/*
var fs = require('fs');
@ -115,12 +114,7 @@ module.exports = function(config) {
name: 'settings',
srcFiles: [
'settings/js/apps.js',
'settings/js/users/deleteHandler.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) {
// it is useful to disable coverage for debugging
// because the coverage preprocessor will wrap the JS files somehow
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 ?)
var appsToTest = process.env.KARMA_TESTSUITE;
if (appsToTest) {
appsToTest = appsToTest.split(' ');
}
else {
} else {
appsToTest = ['core'].concat(findApps());
}
@ -197,7 +193,7 @@ module.exports = function(config) {
function addApp(app) {
// if only a string was specified, expand to structure
if (typeof(app) === 'string') {
if (typeof app === 'string') {
app = {
srcFiles: 'apps/' + app + '/js/**/*.js',
testFiles: 'apps/' + app + '/tests/js/**/*.js'
@ -222,18 +218,42 @@ module.exports = function(config) {
}
// serve images to avoid warnings
files.push({pattern: 'core/img/**/*', watched: false, included: false, served: true});
files.push({pattern: 'core/css/images/*', watched: false, included: false, served: true});
files.push({
pattern: 'core/img/**/*',
watched: false,
included: false,
served: true
});
files.push({
pattern: 'core/css/images/*',
watched: false,
included: false,
served: true
});
// include core CSS
files.push({pattern: 'core/css/*.css', watched: true, included: true, served: true});
files.push({pattern: 'tests/css/*.css', watched: true, included: true, served: true});
files.push({
pattern: 'core/css/*.css',
watched: true,
included: true,
served: true
});
files.push({
pattern: 'tests/css/*.css',
watched: true,
included: true,
served: true
});
// 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({
// base path, that will be used to resolve files and exclude
basePath: '..',
@ -244,9 +264,7 @@ module.exports = function(config) {
files: files,
// list of files to exclude
exclude: [
],
exclude: [],
proxies: {
// prevent warnings for images
@ -282,7 +300,6 @@ module.exports = function(config) {
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
@ -298,8 +315,25 @@ module.exports = function(config) {
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
// - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
// use PhantomJS_debug for extra local debug
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
captureTimeout: 60000,

Loading…
Cancel
Save