Skip to content

Commit

Permalink
Chore: Increase code coverage (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
btmills committed Apr 29, 2017
1 parent 29f2f05 commit cc7deea
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/lib/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,40 @@ describe("processor", function() {
].join("\n"));
});

it("should ignore non-eslint comments", function() {
var code = [
"<!-- eslint-env browser -->",
"<!-- not an eslint comment -->",
"",
"```js",
"alert('Hello, world!');",
"```"
].join("\n");
var blocks = processor.preprocess(code);

assert.equal(blocks.length, 1);
assert.equal(blocks[0], [
"alert('Hello, world!');"
].join("\n"));
});

it("should ignore non-comment html", function() {
var code = [
"<!-- eslint-env browser -->",
"<p>For example:</p>",
"",
"```js",
"alert('Hello, world!');",
"```"
].join("\n");
var blocks = processor.preprocess(code);

assert.equal(blocks.length, 1);
assert.equal(blocks[0], [
"alert('Hello, world!');"
].join("\n"));
});

});

describe("postprocess", function() {
Expand Down

0 comments on commit cc7deea

Please sign in to comment.