From 19baee224290d4f2d906911e45a57636b1f08d5e Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 26 Jun 2016 22:50:50 +0200 Subject: [PATCH] Add testcase for space-comment and shebang babel/babel-eslint#163 This works as of babylon 6.8.2 --- .../test/non-regression.js | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index d6b5d958a7..8caf04aaa6 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1499,20 +1499,32 @@ describe("verify", function () { }); it("newline-before-return with comments #289", function () { - verifyAndAssertMessages(["function a() {", - "if (b) {", - "/* eslint-disable no-console */", - "console.log('test');", - "/* eslint-enable no-console */", - "}", - "", - "return hasGlobal;", - "}"].join("\n"), + verifyAndAssertMessages([ + "function a() {", + "if (b) {", + "/* eslint-disable no-console */", + "console.log('test');", + "/* eslint-enable no-console */", + "}", + "", + "return hasGlobal;", + "}" + ].join("\n"), { "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 () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",