Skip to content

Commit

Permalink
Chore: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Jun 4, 2021
1 parent d1a01a2 commit 6863e8f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/lib/linter/linter.js
Expand Up @@ -2959,15 +2959,20 @@ var a = "test2";

// https://github.com/eslint/eslint/issues/14652
it("should not report a violation", () => {
const code = "/*eslint-env es6\n */ new Promise();";

const codes = [
"/*eslint-env es6\n */ new Promise();",
"/*eslint-env browser,\nes6 */ window;Promise;",
"/*eslint-env\nbrowser,es6 */ window;Promise;"
];
const config = { rules: { "no-undef": 1 } };

const messages = linter.verify(code, config, filename);
for (const code of codes) {
const messages = linter.verify(code, config, filename);

assert.strictEqual(messages.length, 0);
});
assert.strictEqual(messages.length, 0);
}

});

it("should not report a violation", () => {
const code = `/*${ESLINT_ENV} mocha,node */ require();describe();`;
Expand Down

0 comments on commit 6863e8f

Please sign in to comment.