Add tests for two issues and rename test suite (babel/babel-eslint#304)

This commit is contained in:
Daniel Tschinder 2016-04-29 23:07:02 +02:00
parent 872449d6fc
commit 2b66040f0d
2 changed files with 21 additions and 1 deletions

View File

@ -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("``");

View File

@ -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)};`);",