Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit c7efe11

Browse files
committed
Add testcase for space-comment and shebang #163
This works as of babylon 6.8.2
1 parent 40cb21c commit c7efe11

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

test/non-regression.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,20 +1499,32 @@ describe("verify", function () {
14991499
});
15001500

15011501
it("newline-before-return with comments #289", function () {
1502-
verifyAndAssertMessages(["function a() {",
1503-
"if (b) {",
1504-
"/* eslint-disable no-console */",
1505-
"console.log('test');",
1506-
"/* eslint-enable no-console */",
1507-
"}",
1508-
"",
1509-
"return hasGlobal;",
1510-
"}"].join("\n"),
1502+
verifyAndAssertMessages([
1503+
"function a() {",
1504+
"if (b) {",
1505+
"/* eslint-disable no-console */",
1506+
"console.log('test');",
1507+
"/* eslint-enable no-console */",
1508+
"}",
1509+
"",
1510+
"return hasGlobal;",
1511+
"}"
1512+
].join("\n"),
15111513
{ "newline-before-return": 1 },
15121514
[]
15131515
);
15141516
});
15151517

1518+
it("spaced-comment with shebang #163", function () {
1519+
verifyAndAssertMessages(["#!/usr/bin/env babel-node",
1520+
"",
1521+
"import {spawn} from 'foobar';"
1522+
].join("\n"),
1523+
{ "spaced-comment": 1 },
1524+
[]
1525+
);
1526+
});
1527+
15161528
// it("regex with es6 unicodeCodePointEscapes", function () {
15171529
// verifyAndAssertMessages(
15181530
// "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",

0 commit comments

Comments
 (0)