Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into greenkeeper/stylelint-config-standard-18.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vertein committed Nov 29, 2017
2 parents 68f9eb4 + d3950ae commit 87c3834
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/src/main/webapp/css/marketplace.less
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@

/* DETAILS PAGE */
.portlet-details-page {
display: flex;
flex: auto;
padding-bottom: 0;

.portlet-title {
Expand Down
80 changes: 80 additions & 0 deletions web/src/main/webapp/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Licensed to Apereo under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Apereo licenses this file to you 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 the following location:
*
* 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.
*/
/* eslint-env node */
module.exports = function(config) {
config.set({

basePath: './',

files: [
'test/main.js',
{pattern: './**', included: false},
],

preprocessors: {
'my-app/**/*.js': 'coverage',
},

autoWatch: true,

frameworks: ['jasmine', 'requirejs'],

customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless'],
},
},

browsers: ['ChromeHeadless'], // or 'Chrome'

plugins: [
'karma-htmlfile-reporter',
'karma-chrome-launcher',
'karma-edge-launcher',
'karma-firefox-launcher',
'karma-ie-launcher',
'karma-safari-launcher',
'karma-jasmine',
'karma-requirejs',
'karma-coverage',
'karma-coveralls',
],

reporters: ['dots', 'html', 'coverage', 'coveralls'],

htmlReporter: {
outputFile: 'test_out/units.html',
},

junitReporter: {
outputFile: 'test_out/unit.xml',
suite: 'unit',
},

coverageReporter: {
// lcov or lcovonly are required for generating lcov.info files
type: 'lcov',
dir: 'coverage/',
},

colors: true,

});
};
55 changes: 55 additions & 0 deletions web/src/main/webapp/test/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Licensed to Apereo under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Apereo licenses this file to you 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 the following location:
*
* 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.
*/
/* eslint-env node */
/* eslint-disable angular/window-service */
// This will be run from the context of karma,
// so using absolute path from karma's '/base'
// eslint-disable-next-line requirejs/no-js-extension
require(['/base/config.js'], function(config) {
// Add additional config for Karma testing
// Karma serves files under "/base", which
// is the basePath from the karma config file
config.baseUrl = '/base';
config.callback = window.__karma__.start;
config.deps = getAllTestFiles();
// eslint-disable-next-line angular/module-getter
require.config(config);

/**
* Find all test files by filename convention
* @return {Object} allTestFiles
*/
function getAllTestFiles() {
var allTestFiles = [];
var TEST_REGEXP = /(spec|test)\.js$/i;
var EXCLUDE_REGEXP = /.*bower_components|node_modules|portal.*/;
var pathToModule = function(path) {
return path.replace(/^\/base\//, '').replace(/\.js$/, '');
};
Object.keys(window.__karma__.files).forEach(function(file) {
if (TEST_REGEXP.test(file)) {
if (!EXCLUDE_REGEXP.test(file)) {
// Normalize paths to RequireJS module names.
allTestFiles.push(pathToModule(file));
}
}
});
return allTestFiles;
}
});

0 comments on commit 87c3834

Please sign in to comment.