Add a test case for conditional expressions just in case.

This commit is contained in:
Daniel Rosenwasser
2017-09-14 14:26:47 -07:00
parent c966059de1
commit 8fbb30453f

View File

@@ -123,6 +123,19 @@ namespace ts {
createSourceFile("source.ts", "", ScriptTarget.ESNext))
);
printsCorrectly("newExpressionOnConditionalExpression", {}, printer => printer.printNode(
EmitHint.Unspecified,
createNew(
createConditional(
createIdentifier("x"), createToken(SyntaxKind.QuestionToken),
createIdentifier("y"), createToken(SyntaxKind.ColonToken),
createIdentifier("z")),
/*typeArguments*/ undefined,
/*argumentsArray*/ undefined
),
createSourceFile("source.ts", "", ScriptTarget.ESNext))
);
// https://github.com/Microsoft/TypeScript/issues/15971
printsCorrectly("classWithOptionalMethodAndProperty", {}, printer => printer.printNode(
EmitHint.Unspecified,