Add tests for two issues and rename test suite (babel/babel-eslint#304)
This commit is contained in:
parent
872449d6fc
commit
2b66040f0d
@ -80,7 +80,7 @@ function parseAndAssertSame(code) {
|
|||||||
// assert.equal(esAST, babylonAST);
|
// assert.equal(esAST, babylonAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("acorn-to-esprima", function () {
|
describe("babylon-to-esprima", function () {
|
||||||
describe("templates", function () {
|
describe("templates", function () {
|
||||||
it("empty template string", function () {
|
it("empty template string", function () {
|
||||||
parseAndAssertSame("``");
|
parseAndAssertSame("``");
|
||||||
|
|||||||
@ -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 () {
|
// it("regex with es6 unicodeCodePointEscapes", function () {
|
||||||
// verifyAndAssertMessages(
|
// verifyAndAssertMessages(
|
||||||
// "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",
|
// "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user