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

Commit

Permalink
Add testcase for space-comment and shebang #163
Browse files Browse the repository at this point in the history
This works as of babylon 6.8.2
  • Loading branch information
danez committed Jun 26, 2016
1 parent 40cb21c commit c7efe11
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions test/non-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)};`);",
Expand Down

0 comments on commit c7efe11

Please sign in to comment.