test(typescript): do not fail debug check on Literal -> Identifier (#1540)

master
Lucas Azzola 2017-05-07 12:39:19 +10:00 committed by Christopher Chedeau
parent 97ea416c69
commit 5fd9cd01de
3 changed files with 18 additions and 1 deletions

View File

@ -189,7 +189,7 @@ function format(input) {
// We change {'key': value} into {key: value}
if (
ast.type === "Property" &&
(ast.type === "Property" || ast.type === "MethodDefinition") &&
typeof ast.key === "object" &&
ast.key &&
(ast.key.type === "Literal" || ast.key.type === "Identifier")

View File

@ -0,0 +1,4 @@
class C {
"foo"();
"bar"() { }
}

View File

@ -1,5 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ClassDeclaration22.ts 1`] = `
class C {
"foo"();
"bar"() { }
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
foo();
bar() {}
}
`;
exports[`badArrayIndex.ts 1`] = `
var results = number[];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~