From d4318aa0d8d6510657cd07d01004fa60321b00ae Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 25 Jul 2015 11:00:42 -0400 Subject: [PATCH] Merge pull request babel/babel-eslint#128 from hzoo/i-124 add tests - for babel/babel-eslint#124 --- .../babel-eslint-parser/test/babel-eslint.js | 12 +++++++ .../test/non-regression.js | 34 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index b9b1201cae..9f0b285068 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -265,6 +265,18 @@ describe("acorn-to-esprima", function () { ].join("\n")); }); + it("block comments #124", function () { + parseAndAssertSame([ + "React.createClass({", + "render() {", + "// return (", + "//
", + "// ); // <-- this is the line that is reported", + "}", + "});" + ].join("\n")); + }); + it("null", function () { parseAndAssertSame("null"); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3709688a96..3d2bd82e07 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1238,4 +1238,38 @@ describe("verify", function () { [] ); }); + + // it("line comment space-in-parens #124", function () { + // verifyAndAssertMessages( + // [ + // "React.createClass({", + // "render() {", + // "// return (", + // "//
", + // "// ); // <-- this is the line that is reported", + // "}", + // "});" + // ].join("\n"), + // { "space-in-parens": 1 }, + // [ ] + // ) + // }); + + it("block comment space-in-parens #124", function () { + verifyAndAssertMessages( + [ + "React.createClass({", + "render() {", + "/*", + "return (", + "
", + "); // <-- this is the line that is reported", + "*/", + "}", + "});" + ].join("\n"), + { "space-in-parens": 1 }, + [ ] + ) + }); });