Skip to content

Commit

Permalink
Increase branch coverage to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
YJ Yang committed Jan 12, 2016
1 parent b07e7a8 commit 4bc124a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ describe('The rule passes', function () {

it(dir, function (done) {

var processor = remark().use(lintPlugin, {
external: ['../index.js'],
'sentence-newline': {
blacklist: ['e.g.'] // see test `blacklist`
}
});
// Deliberately diversifying our plugin options to increase branch
// coverage.
var pluginOptions = {
external: ['../index.js']
};
if (dir === 'exclamation-mark') {
pluginOptions['sentence-newline'] = {
blacklist: ['e.g.']
};
}
if (dir === 'blacklist') {
pluginOptions['sentence-newline'] = {
blacklist: ['e.g.']
};
}

var processor = remark().use(lintPlugin, pluginOptions);

processor.process(
fs.readFileSync(path.join(__dirname, dir, 'file.md')).toString(),
Expand Down

0 comments on commit 4bc124a

Please sign in to comment.