Add testcase for space-comment and shebang babel/babel-eslint#163

This works as of babylon 6.8.2
This commit is contained in:
Daniel Tschinder 2016-06-26 22:50:50 +02:00
parent ce54b07e2d
commit 19baee2242

View File

@ -1499,7 +1499,8 @@ describe("verify", function () {
}); });
it("newline-before-return with comments #289", function () { it("newline-before-return with comments #289", function () {
verifyAndAssertMessages(["function a() {", verifyAndAssertMessages([
"function a() {",
"if (b) {", "if (b) {",
"/* eslint-disable no-console */", "/* eslint-disable no-console */",
"console.log('test');", "console.log('test');",
@ -1507,12 +1508,23 @@ describe("verify", function () {
"}", "}",
"", "",
"return hasGlobal;", "return hasGlobal;",
"}"].join("\n"), "}"
].join("\n"),
{ "newline-before-return": 1 }, { "newline-before-return": 1 },
[] []
); );
}); });
it("spaced-comment with shebang #163", function () {
verifyAndAssertMessages(["#!/usr/bin/env babel-node",
"",
"import {spawn} from 'foobar';"
].join("\n"),
{ "spaced-comment": 1 },
[]
);
});
// it("regex with es6 unicodeCodePointEscapes", function () { // it("regex with es6 unicodeCodePointEscapes", function () {
// verifyAndAssertMessages( // verifyAndAssertMessages(
// "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",