Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dthree committed Oct 15, 2015
1 parent 79ac715 commit 615bb47
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions dist/clerk/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var config = {
try {
config = JSON.parse(fs.readFileSync(self.app.clerk.paths['static'].config, { encoding: 'utf-8' }));
this._staticConfig = config;
/* istanbul ignore next */
} catch (e) {
console.log(chalk.yellow('\n\nHouston, we have a problem.\nWat can\'t read its static config file, which should be at ' + this.app.clerk.paths['static'].config + '. Without this, Wat can\'t do much. Try re-installing Wat from scratch.\n\nIf that doesn\'t work, please file an issue.\n'));
throw new Error(e);
Expand All @@ -52,6 +53,7 @@ var config = {
config = JSON.parse(fs.readFileSync(this.app.clerk.paths.temp.config, { encoding: 'utf-8' }));
this._config = config;
} catch (e) {
/* istanbul ignore next */
this._config = this.getStatic();
}
} else {
Expand All @@ -69,10 +71,12 @@ var config = {
try {
var json = JSON.parse(data);
callback(undefined, json);
/* istanbul ignore next */
} catch (e) {
callback('Error parsing json: ' + data + ', Error: ' + e + ', url: ' + url);
}
} else {
/* istanbul ignore next */
callback(err);
}
});
Expand Down
4 changes: 3 additions & 1 deletion dist/clerk/indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ var indexer = {
next();
});

/* istanbul ignore next */
walker.on('errors', function (root, nodeStatsArray) {
/* istanbul ignore next */
console.log(root, nodeStatsArray);
throw new Error(root);
});
Expand Down Expand Up @@ -261,6 +261,7 @@ var indexer = {
next();
});

/* istanbul ignore next */
walker.on('errors', function (root, nodeStatsArray) {
console.log(root, nodeStatsArray);
throw new Error(root);
Expand Down Expand Up @@ -458,6 +459,7 @@ var indexer = {
} catch (e) {
/* istanbul ignore next */
err2 = true;
/* istanbul ignore next */
callback('Error parsing remote index json: ' + data + ', Error: ' + e + ', url: ' + self.clerk.paths.remote.config + 'index.json');
}
if (!err2) {
Expand Down
4 changes: 4 additions & 0 deletions src/clerk/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const config = {
try {
config = JSON.parse(fs.readFileSync(self.app.clerk.paths.static.config, {encoding: 'utf-8'}));
this._staticConfig = config;
/* istanbul ignore next */
} catch(e) {
console.log(chalk.yellow(`\n\nHouston, we have a problem.\nWat can\'t read its static config file, which should be at ${this.app.clerk.paths.static.config}. Without this, Wat can\'t do much. Try re-installing Wat from scratch.\n\nIf that doesn\'t work, please file an issue.\n`));
throw new Error(e);
Expand All @@ -52,6 +53,7 @@ const config = {
config = JSON.parse(fs.readFileSync(this.app.clerk.paths.temp.config, {encoding: 'utf-8'}));
this._config = config;
} catch(e) {
/* istanbul ignore next */
this._config = this.getStatic();
}
} else {
Expand All @@ -69,10 +71,12 @@ const config = {
try {
const json = JSON.parse(data);
callback(undefined, json);
/* istanbul ignore next */
} catch(e) {
callback(`Error parsing json: ${data}, Error: ${e}, url: ${url}`);
}
} else {
/* istanbul ignore next */
callback(err);
}
});
Expand Down
4 changes: 3 additions & 1 deletion src/clerk/indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ const indexer = {
next();
});

/* istanbul ignore next */
walker.on('errors', function (root, nodeStatsArray) {
/* istanbul ignore next */
console.log(root, nodeStatsArray);
throw new Error(root);
});
Expand Down Expand Up @@ -261,6 +261,7 @@ const indexer = {
next();
});

/* istanbul ignore next */
walker.on('errors', function (root, nodeStatsArray) {
console.log(root, nodeStatsArray);
throw new Error(root);
Expand Down Expand Up @@ -454,6 +455,7 @@ const indexer = {
} catch(e) {
/* istanbul ignore next */
err2 = true;
/* istanbul ignore next */
callback(`Error parsing remote index json: ${data}, Error: ${e}, url: ${self.clerk.paths.remote.config}index.json`);
}
if (!err2) {
Expand Down

0 comments on commit 615bb47

Please sign in to comment.