Skip to content

Commit

Permalink
Add two test cases for tsx and generics interaction. (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonbloom authored Feb 17, 2021
1 parent add2790 commit 9083b9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/js_parser/ts_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1505,8 +1505,10 @@ func TestTSJSX(t *testing.T) {
expectPrintedTSX(t, "(<T extends={false}>(y) => {}</T>)", "/* @__PURE__ */ React.createElement(T, {\n extends: false\n}, \"(y) => \");\n")
expectPrintedTSX(t, "(<T extends X>(y) => {})", "(y) => {\n};\n")
expectPrintedTSX(t, "(<T extends X = Y>(y) => {})", "(y) => {\n};\n")
expectPrintedTSX(t, "(<T,>() => {})", "() => {\n};\n")
expectPrintedTSX(t, "(<T, X>(y) => {})", "(y) => {\n};\n")
expectPrintedTSX(t, "(<T, X>(y): (() => {}) => {})", "(y) => {\n};\n")
expectParseErrorTSX(t, "(<T>() => {})", "<stdin>: error: Unexpected end of file\n")
expectParseErrorTSX(t, "(<[]>(y))", "<stdin>: error: Expected identifier but found \"[\"\n")
expectParseErrorTSX(t, "(<T[]>(y))", "<stdin>: error: Expected \">\" but found \"[\"\n")
expectParseErrorTSX(t, "(<T = X>(y))", "<stdin>: error: Expected \">\" but found \"=\"\n")
Expand Down

0 comments on commit 9083b9f

Please sign in to comment.