Skip to content

Commit

Permalink
Merge pull request #829 from OpenGeoscience/use-karma-spec-reporter
Browse files Browse the repository at this point in the history
Switch test progress to use the karma-spec-reporter.
  • Loading branch information
manthey authored May 30, 2018
2 parents 5a4006f + 44182c1 commit d263035
Show file tree
Hide file tree
Showing 6 changed files with 1,377 additions and 1,357 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ before_install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x24"
- CACHE="${HOME}/cache" CMAKE_VERSION=3.5.0 CMAKE_SHORT_VERSION=3.5 source ./scripts/install_cmake.sh
- npm install -g npm@latest
- npm install -g node-pre-gyp
- npm prune
# Prune the npm packages. If this fails for any reason, just remove them all
- npm prune || rm -r node_modules

install:
# travis moved to "npm ci", but that fails with canvas-prebuilt as it tries
# to install it before node-pre-gyp
- npm install

before_script:
- export DISPLAY=:99.0
Expand Down
4 changes: 3 additions & 1 deletion karma-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,11 @@ module.exports = function (config) {
},
browserNoActivityTimeout: 30000,
reporters: [
'progress',
'spec', // we had used the 'progress' reporter in the past.
'kjhtml'
],
// We could suppress passing results
// specReporter = {suppressPassed: true, suppressSkipped: true},
middleware: [
'notes',
'osmtiles'
Expand Down
6 changes: 4 additions & 2 deletions karma-cov.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function subdir_name(b) {
/* Use thes test case and as part of the name so that different tests end
* up in different coverage directories. Get the last element of the path
* without the extension from the test case for this purpose. */
var parts = /^(.+\/)*(([^\/]+)\.[^\/.]*|[^\/.]+)$/.exec(process.env.GEOJS_TEST_CASE);
var parts = /^(.+\/)*(([^/]+)\.[^/.]*|[^/.]+)$/.exec(process.env.GEOJS_TEST_CASE);
if (parts) {
subdir += '_' + (parts[3] || parts[2]);
}
Expand All @@ -29,7 +29,9 @@ function subdir_name(b) {
module.exports = function (config) {
var karma_config = require('./karma-base')(config);

karma_config.reporters = ['progress', 'coverage'];
karma_config.reporters = ['spec', 'coverage'];
/* Suppress listing passing and skipped tests when getting coverage. */
karma_config.specReporter = {suppressPassed: true, suppressSkipped: true};
karma_config.coverageReporter = {
reporters: [
{type: 'html', dir: 'dist/coverage/', subdir: subdir_name},
Expand Down
Loading

0 comments on commit d263035

Please sign in to comment.