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

Commit 2655464

Browse files
committed
Add tests for two issues and rename test suite (#304)
1 parent 26f665e commit 2655464

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

test/babel-eslint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function parseAndAssertSame(code) {
8080
// assert.equal(esAST, babylonAST);
8181
}
8282

83-
describe("acorn-to-esprima", function () {
83+
describe("babylon-to-esprima", function () {
8484
describe("templates", function () {
8585
it("empty template string", function () {
8686
parseAndAssertSame("``");

test/non-regression.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,26 @@ describe("verify", function () {
14521452
);
14531453
});
14541454

1455+
it("new.target is not reported as undef #235", function () {
1456+
verifyAndAssertMessages(
1457+
"function foo () { return new.target }",
1458+
{ "no-undef": 1 },
1459+
[]
1460+
);
1461+
});
1462+
1463+
it("decorator does not create TypeError #229", function () {
1464+
verifyAndAssertMessages([
1465+
"class A {",
1466+
" @test",
1467+
" f() {}",
1468+
"}"
1469+
].join("\n"),
1470+
{ "no-undef": 1 },
1471+
[ "2:4 'test' is not defined. no-undef"]
1472+
);
1473+
});
1474+
14551475
// it("regex with es6 unicodeCodePointEscapes", function () {
14561476
// verifyAndAssertMessages(
14571477
// "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",

0 commit comments

Comments
 (0)