diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-06-15 17:53:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 17:53:05 +0200 |
commit | b1893e65f20cf92585f59415eb23e709e32149b6 (patch) | |
tree | 857cc351c344b085b1ae430fb11b099cf4acd2e4 /cli/tests | |
parent | 0ffc99a61ddfa958a436beef0d003ecead630d0f (diff) |
fix(compiler): JSX compilation and provide better error message (#6300)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration_tests.rs | 5 | ||||
-rw-r--r-- | cli/tests/jsx_import_from_ts.App.jsx | 11 | ||||
-rw-r--r-- | cli/tests/jsx_import_from_ts.ts | 3 | ||||
-rw-r--r-- | cli/tests/jsx_import_from_ts.ts.out | 1 |
4 files changed, 20 insertions, 0 deletions
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 ( + <div> + <h2>asdf</h2> + </div> + ); +}
\ 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] |