Skip to content

Commit

Permalink
fix wrong conf property and use noop in remap
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos García committed Sep 20, 2016
1 parent 835ae23 commit 859fbc4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion server/context/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ENV_NOT_DEFINED = '/SET/ENV/COVERAGE_APP_FOLDER/OR/READ/README/';

export const COVERAGE_APP_FOLDER = meteor_parameters.COVERAGE_APP_FOLDER || process.env['COVERAGE_APP_FOLDER'] || ENV_NOT_DEFINED;

/* istanbul ignore else */
if (COVERAGE_APP_FOLDER === ENV_NOT_DEFINED) {
Log.error('Error: COVERAGE_APP_FOLDER is undefined and the coverage will fail.');
}
Expand All @@ -26,6 +27,7 @@ let configuration = {
include: [],
output: NOT_DEFINED
};
/* istanbul ignore else */
if (IS_COVERAGE_ACTIVE) {
const fs = Npm.require('fs'),
path = Npm.require('path');
Expand Down Expand Up @@ -54,36 +56,43 @@ if (IS_COVERAGE_ACTIVE) {
// Don't force to rewrite all the key of configuration.exclude,
// if they are not defined, the default conf is used.

/* istanbul ignore else */
if (configuration.exclude === undefined) {
Log.info('Loading default configuration: exclude.*');
configuration.exclude = defaultConfig.exclude;
}

/* istanbul ignore else */
if (configuration.exclude.general === undefined) {
Log.info('Loading default configuration: exclude.general');
configuration.exclude.general = defaultConfig.exclude.general;
}

/* istanbul ignore else */
if (configuration.exclude.server === undefined) {
Log.info('Loading default configuration: exclude.server');
configuration.exclude.server = defaultConfig.exclude.server;
}

/* istanbul ignore else */
if (configuration.exclude.client === undefined) {
Log.info('Loading default configuration: exclude.client');
configuration.exclude.client = defaultConfig.exclude.client;
}

/* istanbul ignore else */
if (configuration.include === undefined) {
Log.info('Loading default configuration: include');
configuration.include = defaultConfig.include || [];
}

/* istanbul ignore else */
if (configuration.output === undefined) {
Log.info('Loading default configuration: output');
configuration.output = defaultConfig.output;
}

/* istanbul ignore else */
if (configuration.remapFormat === undefined) {
Log.info('Loading default configuration: remapFormat');
configuration.remapFormat = defaultConfig.remapFormat;
Expand All @@ -102,5 +111,5 @@ Log.info('- COVERAGE_APP_FOLDER=', COVERAGE_APP_FOLDER);
Log.info('.coverage.json values:');
Log.info('- exclude=', configuration.exclude);
Log.info('- include=', configuration.include);
Log.info('- remapFormat=', configuration.remap);
Log.info('- remapFormat=', configuration.remapFormat);
Log.info('- COVERAGE_EXPORT_FOLDER=', COVERAGE_EXPORT_FOLDER);
2 changes: 1 addition & 1 deletion server/report/report-remap.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class {
let sourceStore = new MemoryStore();
let collector = remapIstanbul.remap(remapIstanbul.loadCoverage(sources), {
sources: sourceStore,
warn: Log.info
warn: function() {}
});

/* istanbul ignore else */
Expand Down

0 comments on commit 859fbc4

Please sign in to comment.