From 2b66040f0dd82a78bf1f0ec08650743a637075d0 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 29 Apr 2016 23:07:02 +0200 Subject: [PATCH] Add tests for two issues and rename test suite (babel/babel-eslint#304) --- .../babel-eslint-parser/test/babel-eslint.js | 2 +- .../test/non-regression.js | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index a66f1c40cb..76005da137 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -80,7 +80,7 @@ function parseAndAssertSame(code) { // assert.equal(esAST, babylonAST); } -describe("acorn-to-esprima", function () { +describe("babylon-to-esprima", function () { describe("templates", function () { it("empty template string", function () { parseAndAssertSame("``"); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 9f1e4d9dea..992667a3df 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1452,6 +1452,26 @@ describe("verify", function () { ); }); + it("new.target is not reported as undef #235", function () { + verifyAndAssertMessages( + "function foo () { return new.target }", + { "no-undef": 1 }, + [] + ); + }); + + it("decorator does not create TypeError #229", function () { + verifyAndAssertMessages([ + "class A {", + " @test", + " f() {}", + "}" + ].join("\n"), + { "no-undef": 1 }, + [ "2:4 'test' is not defined. no-undef"] + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",