0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

tests: add more jsxImportSource regression tests (#15592)

This commit adds some regression tests for using `jsxImportSource` in
the config file in combination with an import map.

These underlying issues were fixed by #15561.

Closes #13389
Closes #14723

---------

Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Luca Casonato 2023-07-07 01:22:22 +02:00 committed by GitHub
parent 106e1bd90e
commit 679a0c428c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 0 deletions

View file

@ -48,6 +48,16 @@ itest!(declaration_header_file_with_no_exports {
output_str: Some(""),
});
itest!(check_jsximportsource_importmap_config {
args: "check --quiet --config check/jsximportsource_importmap_config/deno.json check/jsximportsource_importmap_config/main.tsx",
output_str: Some(""),
});
itest!(bundle_jsximportsource_importmap_config {
args: "bundle --quiet --config check/jsximportsource_importmap_config/deno.json check/jsximportsource_importmap_config/main.tsx",
output: "check/jsximportsource_importmap_config/main.bundle.js",
});
itest!(check_npm_install_diagnostics {
args: "check --quiet check/npm_install_diagnostics/main.ts",
output: "check/npm_install_diagnostics/main.out",

View file

@ -0,0 +1,7 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "jsx"
},
"importMap": "./import_map.json"
}

View file

@ -0,0 +1,5 @@
{
"imports": {
"jsx/jsx-runtime": "./jsx_runtime.ts"
}
}

View file

@ -0,0 +1,4 @@
// deno-lint-ignore no-namespace
export namespace JSX {
export type IntrinsicElements = { [key: string]: unknown };
}

View file

@ -0,0 +1,9 @@
// deno-fmt-ignore-file
// deno-lint-ignore-file
// This code was bundled using `deno bundle` and it's not recommended to edit it manually
const makeParagraph = ()=>jsx("p", {
children: "A paragraph!"
});
export { makeParagraph as makeParagraph };

View file

@ -0,0 +1 @@
export const makeParagraph = () => <p>A paragraph!</p>;