diff options
Diffstat (limited to 'cli/tests/testdata/dynamic_import')
5 files changed, 16 insertions, 1 deletions
diff --git a/cli/tests/testdata/dynamic_import/empty_1.ts b/cli/tests/testdata/dynamic_import/empty_1.ts new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cli/tests/testdata/dynamic_import/empty_1.ts diff --git a/cli/tests/testdata/dynamic_import/empty_2.ts b/cli/tests/testdata/dynamic_import/empty_2.ts new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cli/tests/testdata/dynamic_import/empty_2.ts diff --git a/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts b/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts index 0033bcccc..65a254191 100644 --- a/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts +++ b/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts @@ -1,3 +1,3 @@ await import( - "http://localhost:4545/dynamic_import/static_remote.ts" + "" + "http://localhost:4545/dynamic_import/static_remote.ts" ); diff --git a/cli/tests/testdata/dynamic_import/static_analysis_no_permissions.ts b/cli/tests/testdata/dynamic_import/static_analysis_no_permissions.ts new file mode 100644 index 000000000..de75ba87b --- /dev/null +++ b/cli/tests/testdata/dynamic_import/static_analysis_no_permissions.ts @@ -0,0 +1,13 @@ +try { + await import("./empty_1.ts"); + console.log("✅ Succeeded importing statically analyzable specifier"); +} catch { + console.log("❌ Failed importing statically analyzable specifier"); +} + +try { + await import("" + "./empty_2.ts"); + console.log("❌ Succeeded importing non-statically analyzable specifier"); +} catch { + console.log("✅ Failed importing non-statically analyzable specifier"); +} diff --git a/cli/tests/testdata/dynamic_import/static_analysis_no_permissions.ts.out b/cli/tests/testdata/dynamic_import/static_analysis_no_permissions.ts.out new file mode 100644 index 000000000..ba9249ab0 --- /dev/null +++ b/cli/tests/testdata/dynamic_import/static_analysis_no_permissions.ts.out @@ -0,0 +1,2 @@ +✅ Succeeded importing statically analyzable specifier +✅ Failed importing non-statically analyzable specifier |