From b1893e65f20cf92585f59415eb23e709e32149b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 15 Jun 2020 17:53:05 +0200 Subject: fix(compiler): JSX compilation and provide better error message (#6300) --- cli/tests/integration_tests.rs | 5 +++++ cli/tests/jsx_import_from_ts.App.jsx | 11 +++++++++++ cli/tests/jsx_import_from_ts.ts | 3 +++ cli/tests/jsx_import_from_ts.ts.out | 1 + 4 files changed, 20 insertions(+) create mode 100644 cli/tests/jsx_import_from_ts.App.jsx create mode 100644 cli/tests/jsx_import_from_ts.ts create mode 100644 cli/tests/jsx_import_from_ts.ts.out (limited to 'cli/tests') diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 66308a499..36e2bc90b 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2015,6 +2015,11 @@ itest!(ts_import_from_js { http_server: true, }); +itest!(jsx_import_from_ts { + args: "run --quiet --reload jsx_import_from_ts.ts", + output: "jsx_import_from_ts.ts.out", +}); + itest!(single_compile_with_reload { args: "run --reload --allow-read single_compile_with_reload.ts", output: "single_compile_with_reload.ts.out", diff --git a/cli/tests/jsx_import_from_ts.App.jsx b/cli/tests/jsx_import_from_ts.App.jsx new file mode 100644 index 000000000..6ea58436b --- /dev/null +++ b/cli/tests/jsx_import_from_ts.App.jsx @@ -0,0 +1,11 @@ +const React = { + createElement() {} +} + +export default function app() { + return ( +
+

asdf

+
+ ); +} \ No newline at end of file diff --git a/cli/tests/jsx_import_from_ts.ts b/cli/tests/jsx_import_from_ts.ts new file mode 100644 index 000000000..3cc916698 --- /dev/null +++ b/cli/tests/jsx_import_from_ts.ts @@ -0,0 +1,3 @@ +import app from "./jsx_import_from_ts.App.jsx"; + +console.log(app); diff --git a/cli/tests/jsx_import_from_ts.ts.out b/cli/tests/jsx_import_from_ts.ts.out new file mode 100644 index 000000000..d449b8c9a --- /dev/null +++ b/cli/tests/jsx_import_from_ts.ts.out @@ -0,0 +1 @@ +[Function: app] -- cgit v1.2.3