diff options
Diffstat (limited to 'tests')
90 files changed, 27 insertions, 1243 deletions
diff --git a/tests/integration/bundle_tests.rs b/tests/integration/bundle_tests.rs deleted file mode 100644 index 20f883293..000000000 --- a/tests/integration/bundle_tests.rs +++ /dev/null @@ -1,476 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -use test_util as util; -use test_util::assert_contains; -use test_util::assert_ends_with; -use test_util::itest; -use test_util::TempDir; - -#[test] -fn bundle_exports() { - // First we have to generate a bundle of some module that has exports. - let mod1 = util::testdata_path().join("subdir/mod1.ts"); - assert!(mod1.is_file()); - let t = TempDir::new(); - let bundle = t.path().join("mod1.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(mod1) - .arg(&bundle) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(bundle.is_file()); - - // Now we try to use that bundle from another module. - let test = t.path().join("test.js"); - std::fs::write( - &test, - " - import { printHello3 } from \"./mod1.bundle.js\"; - printHello3(); ", - ) - .unwrap(); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg(&test) - .output() - .unwrap(); - // check the output of the test.ts program. - assert_ends_with!( - std::str::from_utf8(&output.stdout).unwrap().trim(), - "Hello", - ); - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_exports_no_check() { - // First we have to generate a bundle of some module that has exports. - let mod1 = util::testdata_path().join("subdir/mod1.ts"); - assert!(mod1.is_file()); - let t = TempDir::new(); - let bundle = t.path().join("mod1.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(mod1) - .arg(&bundle) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(bundle.is_file()); - - // Now we try to use that bundle from another module. - let test = t.path().join("test.js"); - std::fs::write( - &test, - " - import { printHello3 } from \"./mod1.bundle.js\"; - printHello3(); ", - ) - .unwrap(); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg(&test) - .output() - .unwrap(); - // check the output of the test.ts program. - assert_ends_with!( - std::str::from_utf8(&output.stdout).unwrap().trim(), - "Hello", - ); - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_circular() { - // First we have to generate a bundle of some module that has exports. - let circular1_path = util::testdata_path().join("subdir/circular1.ts"); - assert!(circular1_path.is_file()); - let t = TempDir::new(); - let bundle_path = t.path().join("circular1.bundle.js"); - - // run this twice to ensure it works even when cached - for _ in 0..2 { - let mut deno = util::deno_cmd_with_deno_dir(&t) - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(&circular1_path) - .arg(&bundle_path) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(bundle_path.is_file()); - } - - let output = util::deno_cmd_with_deno_dir(&t) - .current_dir(util::testdata_path()) - .arg("run") - .arg(&bundle_path) - .output() - .unwrap(); - // check the output of the bundle program. - assert_ends_with!( - std::str::from_utf8(&output.stdout).unwrap().trim(), - "f2\nf1", - ); - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_single_module() { - // First we have to generate a bundle of some module that has exports. - let single_module = util::testdata_path().join("subdir/single_module.ts"); - assert!(single_module.is_file()); - let t = TempDir::new(); - let bundle = t.path().join("single_module.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(single_module) - .arg(&bundle) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(bundle.is_file()); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg(&bundle) - .output() - .unwrap(); - // check the output of the bundle program. - assert_ends_with!( - std::str::from_utf8(&output.stdout).unwrap().trim(), - "Hello world!", - ); - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_tla() { - // First we have to generate a bundle of some module that has exports. - let tla_import = util::testdata_path().join("subdir/tla.ts"); - assert!(tla_import.is_file()); - let t = TempDir::new(); - let bundle = t.path().join("tla.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(tla_import) - .arg(&bundle) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(bundle.is_file()); - - // Now we try to use that bundle from another module. - let test = t.path().join("test.js"); - std::fs::write( - &test, - " - import { foo } from \"./tla.bundle.js\"; - console.log(foo); ", - ) - .unwrap(); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg(&test) - .output() - .unwrap(); - // check the output of the test.ts program. - assert_ends_with!( - std::str::from_utf8(&output.stdout).unwrap().trim(), - "Hello", - ); - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_js() { - // First we have to generate a bundle of some module that has exports. - let mod6 = util::testdata_path().join("subdir/mod6.js"); - assert!(mod6.is_file()); - let t = TempDir::new(); - let bundle = t.path().join("mod6.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(mod6) - .arg(&bundle) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(bundle.is_file()); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg(&bundle) - .output() - .unwrap(); - // check that nothing went to stderr - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_dynamic_import() { - let _g = util::http_server(); - let dynamic_import = util::testdata_path().join("bundle/dynamic_import.ts"); - assert!(dynamic_import.is_file()); - let t = TempDir::new(); - let output_path = t.path().join("bundle_dynamic_import.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(dynamic_import) - .arg(&output_path) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(output_path.is_file()); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg("--allow-net") - .arg("--quiet") - .arg(&output_path) - .output() - .unwrap(); - // check the output of the test.ts program. - assert_ends_with!( - std::str::from_utf8(&output.stdout).unwrap().trim(), - "Hello", - ); - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_import_map() { - let import = util::testdata_path().join("bundle/import_map/main.ts"); - let import_map_path = - util::testdata_path().join("bundle/import_map/import_map.json"); - assert!(import.is_file()); - let t = TempDir::new(); - let output_path = t.path().join("import_map.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg("--import-map") - .arg(import_map_path) - .arg(import) - .arg(&output_path) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(output_path.is_file()); - - // Now we try to use that bundle from another module. - let test = t.path().join("test.js"); - std::fs::write( - &test, - " - import { printHello3 } from \"./import_map.bundle.js\"; - printHello3(); ", - ) - .unwrap(); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg("--check") - .arg(&test) - .output() - .unwrap(); - // check the output of the test.ts program. - assert_ends_with!( - std::str::from_utf8(&output.stdout).unwrap().trim(), - "Hello", - ); - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_import_map_no_check() { - let import = util::testdata_path().join("bundle/import_map/main.ts"); - let import_map_path = - util::testdata_path().join("bundle/import_map/import_map.json"); - assert!(import.is_file()); - let t = TempDir::new(); - let output_path = t.path().join("import_map.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg("--import-map") - .arg(import_map_path) - .arg(import) - .arg(&output_path) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(output_path.is_file()); - - // Now we try to use that bundle from another module. - let test = t.path().join("test.js"); - std::fs::write( - &test, - " - import { printHello3 } from \"./import_map.bundle.js\"; - printHello3(); ", - ) - .unwrap(); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg(&test) - .output() - .unwrap(); - // check the output of the test.ts program. - assert_ends_with!( - std::str::from_utf8(&output.stdout).unwrap().trim(), - "Hello", - ); - assert_eq!(output.stderr, b""); -} - -#[test] -fn bundle_json_module() { - // First we have to generate a bundle of some module that has exports. - let mod7 = util::testdata_path().join("subdir/mod7.js"); - assert!(mod7.is_file()); - let t = TempDir::new(); - let bundle = t.path().join("mod7.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(mod7) - .arg(&bundle) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(bundle.is_file()); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg(&bundle) - .output() - .unwrap(); - // check that nothing went to stderr - assert_eq!(output.stderr, b""); - // ensure the output looks right - assert_contains!(String::from_utf8(output.stdout).unwrap(), "with space",); -} - -#[test] -fn bundle_json_module_escape_sub() { - // First we have to generate a bundle of some module that has exports. - let mod8 = util::testdata_path().join("subdir/mod8.js"); - assert!(mod8.is_file()); - let t = TempDir::new(); - let bundle = t.path().join("mod8.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg(mod8) - .arg(&bundle) - .spawn() - .unwrap(); - let status = deno.wait().unwrap(); - assert!(status.success()); - assert!(bundle.is_file()); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg(&bundle) - .output() - .unwrap(); - // check that nothing went to stderr - assert_eq!(output.stderr, b""); - // make sure the output looks right and the escapes were effective - assert_contains!( - String::from_utf8(output.stdout).unwrap(), - "${globalThis}`and string literal`", - ); -} - -itest!(bundle { - args: "bundle subdir/mod1.ts", - output: "bundle/bundle.test.out", -}); - -itest!(bundle_jsx { - args: "bundle run/jsx_import_from_ts.ts", - output: "bundle/jsx.out", -}); - -itest!(error_bundle_with_bare_import { - args: "bundle bundle/bare_imports/error_with_bare_import.ts", - output: "bundle/bare_imports/error_with_bare_import.ts.out", - exit_code: 1, -}); - -itest!(ts_decorators_bundle { - args: "bundle bundle/decorators/ts_decorators.ts", - output: "bundle/decorators/ts_decorators.out", -}); - -itest!(bundle_export_specifier_with_alias { - args: "bundle bundle/file_tests-fixture16.ts", - output: "bundle/fixture16.out", -}); - -itest!(bundle_ignore_directives { - args: "bundle subdir/mod1.ts", - output: "bundle/ignore_directives.test.out", -}); - -itest!(check_local_by_default_no_errors { - args: "bundle --quiet bundle/check_local_by_default/no_errors.ts", - output: "bundle/check_local_by_default/no_errors.out", - http_server: true, -}); - -itest!(check_local_by_default_type_error { - args: "bundle --quiet bundle/check_local_by_default/type_error.ts", - output: "bundle/check_local_by_default/type_error.out", - http_server: true, - exit_code: 1, -}); - -itest!(ts_without_extension { - args: "bundle --ext ts file_extensions/ts_without_extension", - output: "bundle/file_extensions/ts_without_extension.out", -}); - -itest!(js_without_extension { - args: "bundle --ext js file_extensions/js_without_extension", - output: "bundle/file_extensions/js_without_extension.out", -}); - -itest!(bundle_shebang_file { - args: "bundle subdir/shebang_file.js", - output: "bundle/shebang_file.bundle.out", -}); diff --git a/tests/integration/check_tests.rs b/tests/integration/check_tests.rs index bcc01cf5d..8bb0ddde2 100644 --- a/tests/integration/check_tests.rs +++ b/tests/integration/check_tests.rs @@ -37,11 +37,6 @@ itest!(check_jsximportsource_importmap_config { 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!(jsx_not_checked { args: "check check/jsx_not_checked/main.jsx", output: "check/jsx_not_checked/main.out", diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index c3f2f9daa..f6dee785d 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1184,8 +1184,7 @@ fn lsp_deno_task() { "deno.jsonc", r#"{ "tasks": { - "build": "deno test", - "some:test": "deno bundle mod.ts" + "build": "deno test" } }"#, ); @@ -1204,10 +1203,6 @@ fn lsp_deno_task() { "name": "build", "detail": "deno test", "sourceUri": temp_dir.url().join("deno.jsonc").unwrap(), - }, { - "name": "some:test", - "detail": "deno bundle mod.ts", - "sourceUri": temp_dir.url().join("deno.jsonc").unwrap(), } ]) ); diff --git a/tests/integration/mod.rs b/tests/integration/mod.rs index d35fabc02..ea3269aaa 100644 --- a/tests/integration/mod.rs +++ b/tests/integration/mod.rs @@ -9,8 +9,6 @@ #[path = "bench_tests.rs"] mod bench; -#[path = "bundle_tests.rs"] -mod bundle; #[path = "cache_tests.rs"] mod cache; #[path = "check_tests.rs"] diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index abc5365b8..91ac5611f 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -10,8 +10,6 @@ use util::DenoChild; use util::assert_not_contains; -const CLEAR_SCREEN: &str = r#"[2J"#; - /// Logs to stderr every time next_line() is called struct LoggingLines<R> where @@ -492,143 +490,6 @@ async fn fmt_check_all_files_on_each_change_test() { } #[flaky_test(tokio)] -async fn bundle_js_watch() { - use std::path::PathBuf; - // Test strategy extends this of test bundle_js by adding watcher - let t = TempDir::new(); - let file_to_watch = t.path().join("file_to_watch.ts"); - file_to_watch.write("console.log('Hello world');"); - assert!(file_to_watch.is_file()); - let t = TempDir::new(); - let bundle = t.path().join("mod6.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(t.path()) - .arg("bundle") - .arg(&file_to_watch) - .arg(&bundle) - .arg("--watch") - .env("NO_COLOR", "1") - .piped_output() - .spawn() - .unwrap(); - - let (_stdout_lines, mut stderr_lines) = child_lines(&mut deno); - - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Warning"); - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "deno_emit"); - assert_contains!( - next_line(&mut stderr_lines).await.unwrap(), - "Bundle started" - ); - let line = next_line(&mut stderr_lines).await.unwrap(); - assert_contains!(line, "file_to_watch.ts"); - assert_contains!(line, "Check"); - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Bundle"); - assert_contains!( - next_line(&mut stderr_lines).await.unwrap(), - "mod6.bundle.js" - ); - let file = PathBuf::from(&bundle); - assert!(file.is_file()); - - wait_contains("Bundle finished", &mut stderr_lines).await; - - file_to_watch.write("console.log('Hello world2');"); - - let line = next_line(&mut stderr_lines).await.unwrap(); - // Should not clear screen, as we are in non-TTY environment - assert_not_contains!(&line, CLEAR_SCREEN); - assert_contains!(&line, "File change detected!"); - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Check"); - assert_contains!( - next_line(&mut stderr_lines).await.unwrap(), - "file_to_watch.ts" - ); - assert_contains!( - next_line(&mut stderr_lines).await.unwrap(), - "mod6.bundle.js" - ); - let file = PathBuf::from(&bundle); - assert!(file.is_file()); - wait_contains("Bundle finished", &mut stderr_lines).await; - - // Confirm that the watcher keeps on working even if the file is updated and has invalid syntax - file_to_watch.write("syntax error ^^"); - - assert_contains!( - next_line(&mut stderr_lines).await.unwrap(), - "File change detected!" - ); - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "error: "); - wait_contains("Bundle failed", &mut stderr_lines).await; - check_alive_then_kill(deno); -} - -/// Confirm that the watcher continues to work even if module resolution fails at the *first* attempt -#[flaky_test(tokio)] -async fn bundle_watch_not_exit() { - let t = TempDir::new(); - let file_to_watch = t.path().join("file_to_watch.ts"); - file_to_watch.write("syntax error ^^"); - let target_file = t.path().join("target.js"); - - let mut deno = util::deno_cmd() - .current_dir(t.path()) - .arg("bundle") - .arg(&file_to_watch) - .arg(&target_file) - .arg("--watch") - .env("NO_COLOR", "1") - .piped_output() - .spawn() - .unwrap(); - let (_stdout_lines, mut stderr_lines) = child_lines(&mut deno); - - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Warning"); - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "deno_emit"); - assert_contains!( - next_line(&mut stderr_lines).await.unwrap(), - "Bundle started" - ); - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "error:"); - assert_eq!(next_line(&mut stderr_lines).await.unwrap(), ""); - assert_eq!( - next_line(&mut stderr_lines).await.unwrap(), - " syntax error ^^" - ); - assert_eq!( - next_line(&mut stderr_lines).await.unwrap(), - " ~~~~~" - ); - assert_contains!( - next_line(&mut stderr_lines).await.unwrap(), - "Bundle failed" - ); - // the target file hasn't been created yet - assert!(!target_file.is_file()); - - // Make sure the watcher actually restarts and works fine with the proper syntax - file_to_watch.write("console.log(42);"); - - assert_contains!( - next_line(&mut stderr_lines).await.unwrap(), - "File change detected" - ); - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Check"); - let line = next_line(&mut stderr_lines).await.unwrap(); - // Should not clear screen, as we are in non-TTY environment - assert_not_contains!(&line, CLEAR_SCREEN); - assert_contains!(line, "file_to_watch.ts"); - assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "target.js"); - - wait_contains("Bundle finished", &mut stderr_lines).await; - - // bundled file is created - assert!(target_file.is_file()); - check_alive_then_kill(deno); -} - -#[flaky_test(tokio)] async fn run_watch_no_dynamic() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); diff --git a/tests/specs/bundle/lockfile/__test__.jsonc b/tests/specs/bundle/lockfile/__test__.jsonc deleted file mode 100644 index 3fe64a28b..000000000 --- a/tests/specs/bundle/lockfile/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "bundle --lock=check_error.json http://127.0.0.1:4545/subdir/mod1.ts", - "output": "check_error.out", - "exitCode": 10 -} diff --git a/tests/specs/bundle/lockfile/check_error.json b/tests/specs/bundle/lockfile/check_error.json deleted file mode 100644 index a218d7000..000000000 --- a/tests/specs/bundle/lockfile/check_error.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "http://127.0.0.1:4545/subdir/mod1.ts": "bfc1037b02c99abc20367f739bca7455813a5950066abd77965bff33b6eece0f", - "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/subdir/subdir2/mod2.ts": "bad" -} diff --git a/tests/specs/bundle/lockfile/check_error.out b/tests/specs/bundle/lockfile/check_error.out deleted file mode 100644 index 6a63a01b4..000000000 --- a/tests/specs/bundle/lockfile/check_error.out +++ /dev/null @@ -1,12 +0,0 @@ -[WILDCARD] -error: Integrity check failed for remote specifier. The source code is invalid, as it does not match the expected hash in the lock file. - - Specifier: http://127.0.0.1:4545/subdir/subdir2/mod2.ts - Actual: 8b3b670d25d238dfa72df119140406b96766a00fee635f3606429fe065b18fd1 - Expected: bad - -This could be caused by: - * the lock file may be corrupt - * the source itself may be corrupt - -Investigate the lockfile; delete it to regenerate the lockfile or --reload to reload the source code from the server. diff --git a/tests/specs/bundle/removed/__test__.jsonc b/tests/specs/bundle/removed/__test__.jsonc new file mode 100644 index 000000000..b33842de2 --- /dev/null +++ b/tests/specs/bundle/removed/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "steps": [ + { + "args": "bundle", + "output": "bundle.out", + "exitCode": 1 + }, + { + "args": "bundle --help", + "output": "bundle_help.out" + } + ] +} diff --git a/tests/specs/bundle/removed/bundle.out b/tests/specs/bundle/removed/bundle.out new file mode 100644 index 000000000..d1d8d00d6 --- /dev/null +++ b/tests/specs/bundle/removed/bundle.out @@ -0,0 +1,3 @@ +error: ⚠️ `deno bundle` was removed in Deno 2. + +See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations diff --git a/tests/specs/bundle/removed/bundle_help.out b/tests/specs/bundle/removed/bundle_help.out new file mode 100644 index 000000000..d8e83b95d --- /dev/null +++ b/tests/specs/bundle/removed/bundle_help.out @@ -0,0 +1,10 @@ +⚠️ `deno bundle` was removed in Deno 2. + +See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations + +Usage: deno bundle [OPTIONS] + +Options: + -q, --quiet Suppress diagnostic output + --unstable Enable all unstable features and APIs. Instead of using this flag, consider enabling individual unstable features + To view the list of individual unstable feature flags, run this command again with --help=unstable diff --git a/tests/specs/cert/cafile_bundle/RootCA.pem b/tests/specs/cert/cafile_bundle/RootCA.pem deleted file mode 100644 index c2f84ceeb..000000000 --- a/tests/specs/cert/cafile_bundle/RootCA.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDIzCCAgugAwIBAgIJAMKPPW4tsOymMA0GCSqGSIb3DQEBCwUAMCcxCzAJBgNV -BAYTAlVTMRgwFgYDVQQDDA9FeGFtcGxlLVJvb3QtQ0EwIBcNMTkxMDIxMTYyODIy -WhgPMjExODA5MjcxNjI4MjJaMCcxCzAJBgNVBAYTAlVTMRgwFgYDVQQDDA9FeGFt -cGxlLVJvb3QtQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMH/IO -2qtHfyBKwANNPB4K0q5JVSg8XxZdRpTTlz0CwU0oRO3uHrI52raCCfVeiQutyZop -eFZTDWeXGudGAFA2B5m3orWt0s+touPi8MzjsG2TQ+WSI66QgbXTNDitDDBtTVcV -5G3Ic+3SppQAYiHSekLISnYWgXLl+k5CnEfTowg6cjqjVr0KjL03cTN3H7b+6+0S -ws4rYbW1j4ExR7K6BFNH6572yq5qR20E6GqlY+EcOZpw4CbCk9lS8/CWuXze/vMs -OfDcc6K+B625d27wyEGZHedBomT2vAD7sBjvO8hn/DP1Qb46a8uCHR6NSfnJ7bXO -G1igaIbgY1zXirNdAgMBAAGjUDBOMB0GA1UdDgQWBBTzut+pwwDfqmMYcI9KNWRD -hxcIpTAfBgNVHSMEGDAWgBTzut+pwwDfqmMYcI9KNWRDhxcIpTAMBgNVHRMEBTAD -AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB9AqSbZ+hEglAgSHxAMCqRFdhVu7MvaQM0 -P090mhGlOCt3yB7kdGfsIrUW6nQcTz7PPQFRaJMrFHPvFvPootkBUpTYR4hTkdce -H6RCRu2Jxl4Y9bY/uezd9YhGCYfUtfjA6/TH9FcuZfttmOOlxOt01XfNvVMIR6RM -z/AYhd+DeOXjr35F/VHeVpnk+55L0PYJsm1CdEbOs5Hy1ecR7ACuDkXnbM4fpz9I -kyIWJwk2zJReKcJMgi1aIinDM9ao/dca1G99PHOw8dnr4oyoTiv8ao6PWiSRHHMi -MNf4EgWfK+tZMnuqfpfO9740KzfcVoMNo4QJD4yn5YxroUOO/Azi ------END CERTIFICATE----- diff --git a/tests/specs/cert/cafile_bundle/__test__.jsonc b/tests/specs/cert/cafile_bundle/__test__.jsonc deleted file mode 100644 index 75c6c87a9..000000000 --- a/tests/specs/cert/cafile_bundle/__test__.jsonc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tempDir": true, - "steps": [{ - "args": "bundle --cert RootCA.pem https://localhost:5545/subdir/mod1.ts mod1.bundle.js", - "flaky": true, - "output": "[WILDCARD]" - }, { - "args": "run --quiet --check test.js", - "output": "[WILDCARD]Hello\n" - }] -} diff --git a/tests/specs/cert/cafile_bundle/test.js b/tests/specs/cert/cafile_bundle/test.js deleted file mode 100644 index 475af44d2..000000000 --- a/tests/specs/cert/cafile_bundle/test.js +++ /dev/null @@ -1,2 +0,0 @@ -import { printHello3 } from "./mod1.bundle.js"; -printHello3(); diff --git a/tests/specs/npm/es_module/__test__.jsonc b/tests/specs/npm/es_module/__test__.jsonc index d72db753f..2ab61686e 100644 --- a/tests/specs/npm/es_module/__test__.jsonc +++ b/tests/specs/npm/es_module/__test__.jsonc @@ -14,11 +14,6 @@ "import chalk from 'npm:chalk@5'; console.log(chalk.green('chalk esm loads'));" ], "output": "main.out" - }, - "bundle": { - "args": "bundle --quiet main.js", - "output": "bundle.out", - "exitCode": 1 } } } diff --git a/tests/specs/npm/es_module/bundle.out b/tests/specs/npm/es_module/bundle.out deleted file mode 100644 index c749a236a..000000000 --- a/tests/specs/npm/es_module/bundle.out +++ /dev/null @@ -1 +0,0 @@ -error: npm specifiers have not yet been implemented for this subcommand (https://github.com/denoland/deno/issues/15960). Found: npm:/chalk@5.0.1 diff --git a/tests/testdata/bundle/bare_imports/error_with_bare_import.ts b/tests/testdata/bundle/bare_imports/error_with_bare_import.ts deleted file mode 100644 index c0748305d..000000000 --- a/tests/testdata/bundle/bare_imports/error_with_bare_import.ts +++ /dev/null @@ -1 +0,0 @@ -import "foo"; diff --git a/tests/testdata/bundle/bare_imports/error_with_bare_import.ts.out b/tests/testdata/bundle/bare_imports/error_with_bare_import.ts.out deleted file mode 100644 index 44d063a5e..000000000 --- a/tests/testdata/bundle/bare_imports/error_with_bare_import.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]error: Relative import path "foo" not prefixed with / or ./ or ../ - at file:///[WILDCARD]/error_with_bare_import.ts:[WILDCARD] diff --git a/tests/testdata/bundle/bundle.test.out b/tests/testdata/bundle/bundle.test.out deleted file mode 100644 index 6b1c109d3..000000000 --- a/tests/testdata/bundle/bundle.test.out +++ /dev/null @@ -1,27 +0,0 @@ -[WILDCARD] -function printHello() { - console.log("Hello"); -} -function returnsFoo() { - return "Foo"; -} -function printHello2() { - printHello(); -} -function returnsHi() { - return "Hi"; -} -function returnsFoo2() { - return returnsFoo(); -} -function printHello3() { - printHello2(); -} -function throwsError() { - throw Error("exception from mod1"); -} -export { returnsHi as returnsHi }; -export { returnsFoo2 as returnsFoo2 }; -export { printHello3 as printHello3 }; -export { throwsError as throwsError }; - diff --git a/tests/testdata/bundle/check_local_by_default/no_errors.out b/tests/testdata/bundle/check_local_by_default/no_errors.out deleted file mode 100644 index c4559d1fa..000000000 --- a/tests/testdata/bundle/check_local_by_default/no_errors.out +++ /dev/null @@ -1,6 +0,0 @@ -// deno-fmt-ignore-file -// deno-lint-ignore-file -// This code was bundled using `deno bundle` and it's not recommended to edit it manually - -console.log(12); - diff --git a/tests/testdata/bundle/check_local_by_default/no_errors.ts b/tests/testdata/bundle/check_local_by_default/no_errors.ts deleted file mode 100644 index 2ae8c2692..000000000 --- a/tests/testdata/bundle/check_local_by_default/no_errors.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as a from "http://localhost:4545/subdir/type_error.ts"; - -console.log(a.a); diff --git a/tests/testdata/bundle/check_local_by_default/type_error.out b/tests/testdata/bundle/check_local_by_default/type_error.out deleted file mode 100644 index 6d53e9498..000000000 --- a/tests/testdata/bundle/check_local_by_default/type_error.out +++ /dev/null @@ -1,4 +0,0 @@ -error: TS2322 [ERROR]: Type '12' is not assignable to type '"b"'. -const b: "b" = 12; - ^ - at [WILDCARD]bundle/check_local_by_default/type_error.ts:3:7 diff --git a/tests/testdata/bundle/check_local_by_default/type_error.ts b/tests/testdata/bundle/check_local_by_default/type_error.ts deleted file mode 100644 index 5177ff944..000000000 --- a/tests/testdata/bundle/check_local_by_default/type_error.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as a from "http://localhost:4545/subdir/type_error.ts"; - -const b: "b" = 12; - -console.log(a.a); -console.log(b); diff --git a/tests/testdata/bundle/decorators/ts_decorators.out b/tests/testdata/bundle/decorators/ts_decorators.out deleted file mode 100644 index e988aadd3..000000000 --- a/tests/testdata/bundle/decorators/ts_decorators.out +++ /dev/null @@ -1,49 +0,0 @@ -[WILDCARD] -// deno-fmt-ignore-file -// deno-lint-ignore-file -// This code was bundled using `deno bundle` and it's not recommended to edit it manually - -function _ts_decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} -function a() { - console.log("a(): evaluated"); - return (_target, _propertyKey, _descriptor)=>{ - console.log("a(): called"); - }; -} -class B { - method() { - console.log("method"); - } -} -_ts_decorate([ - a() -], B.prototype, "method", null); -function _ts_decorate1(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} -function Decorator() { - return function(target, propertyKey, descriptor) { - const originalFn = descriptor.value; - descriptor.value = async function(...args) { - return await originalFn.apply(this, args); - }; - return descriptor; - }; -} -class SomeClass { - async test() {} -} -_ts_decorate1([ - Decorator() -], SomeClass.prototype, "test", null); -new SomeClass().test(); -new B().method(); -[WILDCARD]
\ No newline at end of file diff --git a/tests/testdata/bundle/decorators/ts_decorators.ts b/tests/testdata/bundle/decorators/ts_decorators.ts deleted file mode 100644 index 61299bccf..000000000 --- a/tests/testdata/bundle/decorators/ts_decorators.ts +++ /dev/null @@ -1,25 +0,0 @@ -// deno-lint-ignore-file - -import { B } from "../../subdir/more_decorators.ts"; - -function Decorator() { - return function ( - target: Record<string, any>, - propertyKey: string, - descriptor: TypedPropertyDescriptor<any>, - ) { - const originalFn: Function = descriptor.value as Function; - descriptor.value = async function (...args: any[]) { - return await originalFn.apply(this, args); - }; - return descriptor; - }; -} - -class SomeClass { - @Decorator() - async test() {} -} - -new SomeClass().test(); -new B().method(); diff --git a/tests/testdata/bundle/dynamic_import.ts b/tests/testdata/bundle/dynamic_import.ts deleted file mode 100644 index d8c7d08ec..000000000 --- a/tests/testdata/bundle/dynamic_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -const mod1 = await import("http://localhost:4545/subdir/mod1.ts"); - -mod1.printHello3(); diff --git a/tests/testdata/bundle/file_extensions/js_without_extension.out b/tests/testdata/bundle/file_extensions/js_without_extension.out deleted file mode 100644 index 0273e6207..000000000 --- a/tests/testdata/bundle/file_extensions/js_without_extension.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD] -// deno-fmt-ignore-file -// deno-lint-ignore-file -// This code was bundled using `deno bundle` and it's not recommended to edit it manually - -"hello"; -console.log("executing javascript with no extension"); - diff --git a/tests/testdata/bundle/file_extensions/ts_without_extension.out b/tests/testdata/bundle/file_extensions/ts_without_extension.out deleted file mode 100644 index 39e355d14..000000000 --- a/tests/testdata/bundle/file_extensions/ts_without_extension.out +++ /dev/null @@ -1,7 +0,0 @@ -[WILDCARD] -// deno-fmt-ignore-file -// deno-lint-ignore-file -// This code was bundled using `deno bundle` and it's not recommended to edit it manually - -console.log("executing typescript with no extension"); - diff --git a/tests/testdata/bundle/file_tests-fixture01.ts b/tests/testdata/bundle/file_tests-fixture01.ts deleted file mode 100644 index 3598d0298..000000000 --- a/tests/testdata/bundle/file_tests-fixture01.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as a from "./subdir/a.ts"; - -console.log(a); diff --git a/tests/testdata/bundle/file_tests-fixture02.ts b/tests/testdata/bundle/file_tests-fixture02.ts deleted file mode 100644 index 0cd291329..000000000 --- a/tests/testdata/bundle/file_tests-fixture02.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as b from "./subdir/b.ts"; - -console.log(b.b); // "b" -console.log(b.c); // { c: "c", default: class C } diff --git a/tests/testdata/bundle/file_tests-fixture03.ts b/tests/testdata/bundle/file_tests-fixture03.ts deleted file mode 100644 index 78365ce13..000000000 --- a/tests/testdata/bundle/file_tests-fixture03.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { d } from "./subdir/d.ts"; - -console.log(d); diff --git a/tests/testdata/bundle/file_tests-fixture04.ts b/tests/testdata/bundle/file_tests-fixture04.ts deleted file mode 100644 index 590f4fef9..000000000 --- a/tests/testdata/bundle/file_tests-fixture04.ts +++ /dev/null @@ -1,3 +0,0 @@ -const a = await import("./subdir/a.ts"); - -console.log(a); diff --git a/tests/testdata/bundle/file_tests-fixture05.ts b/tests/testdata/bundle/file_tests-fixture05.ts deleted file mode 100644 index 19541ce59..000000000 --- a/tests/testdata/bundle/file_tests-fixture05.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { a } from "./subdir/e.ts"; - -console.log(a); diff --git a/tests/testdata/bundle/file_tests-fixture06.ts b/tests/testdata/bundle/file_tests-fixture06.ts deleted file mode 100644 index 3d94332df..000000000 --- a/tests/testdata/bundle/file_tests-fixture06.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { isMain, modUrl } from "./subdir/f.ts"; - -console.log(isMain, modUrl); -console.log(import.meta.main, import.meta.url); diff --git a/tests/testdata/bundle/file_tests-fixture07.ts b/tests/testdata/bundle/file_tests-fixture07.ts deleted file mode 100644 index 0475a6c53..000000000 --- a/tests/testdata/bundle/file_tests-fixture07.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { G } from "./subdir/g.ts"; -import { H } from "./subdir/h.ts"; - -console.log(new G(true), new H(true)); diff --git a/tests/testdata/bundle/file_tests-fixture08.ts b/tests/testdata/bundle/file_tests-fixture08.ts deleted file mode 100644 index 6af5d172e..000000000 --- a/tests/testdata/bundle/file_tests-fixture08.ts +++ /dev/null @@ -1 +0,0 @@ -export * as a from "./subdir/a.ts"; diff --git a/tests/testdata/bundle/file_tests-fixture09.ts b/tests/testdata/bundle/file_tests-fixture09.ts deleted file mode 100644 index 30ba983ee..000000000 --- a/tests/testdata/bundle/file_tests-fixture09.ts +++ /dev/null @@ -1 +0,0 @@ -export { a } from "./subdir/k.ts"; diff --git a/tests/testdata/bundle/file_tests-fixture10.ts b/tests/testdata/bundle/file_tests-fixture10.ts deleted file mode 100644 index bec555da8..000000000 --- a/tests/testdata/bundle/file_tests-fixture10.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { a as defaultA } from "./subdir/l.ts"; - -const o: { a?: string } = {}; - -const { a = defaultA } = o; - -console.log(a); diff --git a/tests/testdata/bundle/file_tests-fixture11.ts b/tests/testdata/bundle/file_tests-fixture11.ts deleted file mode 100644 index 1c361438f..000000000 --- a/tests/testdata/bundle/file_tests-fixture11.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { a as defaultA, O } from "./subdir/m.ts"; -export { O } from "./subdir/m.ts"; - -interface AOptions { - a?(); - c?: O; -} - -class A { - #a: () => void; - #c?: O; - constructor(o: AOptions = {}) { - const { - a = defaultA, - c, - } = o; - this.#a = a; - this.#c = c; - } - - a() { - this.#a(); - } - - c() { - console.log(this.#c); - } -} - -const a = new A(); -a.a(); -a.c(); diff --git a/tests/testdata/bundle/file_tests-fixture12.ts b/tests/testdata/bundle/file_tests-fixture12.ts deleted file mode 100644 index 32b9566bd..000000000 --- a/tests/testdata/bundle/file_tests-fixture12.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { a } from "./subdir/p.ts"; - -function b() { - a(); -} - -b(); diff --git a/tests/testdata/bundle/file_tests-fixture13.ts b/tests/testdata/bundle/file_tests-fixture13.ts deleted file mode 100644 index 7dc13534c..000000000 --- a/tests/testdata/bundle/file_tests-fixture13.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { D, d } from "./subdir/q.ts"; - -class A { - private s: D = d(); - - a() { - this.s.resolve(); - } -} - -new A(); diff --git a/tests/testdata/bundle/file_tests-fixture14.ts b/tests/testdata/bundle/file_tests-fixture14.ts deleted file mode 100644 index aa8eef1b8..000000000 --- a/tests/testdata/bundle/file_tests-fixture14.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @deno-types="https://deno.land/x/lib/mod.d.ts" -import * as lib from "https://deno.land/x/lib/mod.js"; - -console.log(lib); diff --git a/tests/testdata/bundle/file_tests-fixture15.ts b/tests/testdata/bundle/file_tests-fixture15.ts deleted file mode 100644 index c1dd3bc89..000000000 --- a/tests/testdata/bundle/file_tests-fixture15.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function getIndex(c: string): number { - return "\x00\r\n\x85\u2028\u2029".indexOf(c); -} diff --git a/tests/testdata/bundle/file_tests-fixture16.ts b/tests/testdata/bundle/file_tests-fixture16.ts deleted file mode 100644 index 5d0b05e92..000000000 --- a/tests/testdata/bundle/file_tests-fixture16.ts +++ /dev/null @@ -1,6 +0,0 @@ -// todo(dsherret): use ./subdir/a.ts once fixtures are restored -export { a as test1 } from "./file_tests-fixture16_2.ts"; -export { a as test2 } from "./file_tests-fixture16_2.ts"; -import { a } from "./file_tests-fixture16_2.ts"; - -console.log(a); diff --git a/tests/testdata/bundle/file_tests-fixture16_2.ts b/tests/testdata/bundle/file_tests-fixture16_2.ts deleted file mode 100644 index 7115949c9..000000000 --- a/tests/testdata/bundle/file_tests-fixture16_2.ts +++ /dev/null @@ -1,2 +0,0 @@ -// todo(dsherret): delete this and use ./subdir/a.ts in the file once fixtures are restored -export const a = "a"; diff --git a/tests/testdata/bundle/file_tests-subdir-a.ts b/tests/testdata/bundle/file_tests-subdir-a.ts deleted file mode 100644 index 9233cce2f..000000000 --- a/tests/testdata/bundle/file_tests-subdir-a.ts +++ /dev/null @@ -1 +0,0 @@ -export const a = "a"; diff --git a/tests/testdata/bundle/file_tests-subdir-b.ts b/tests/testdata/bundle/file_tests-subdir-b.ts deleted file mode 100644 index 1cf751c22..000000000 --- a/tests/testdata/bundle/file_tests-subdir-b.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * as c from "./c.ts"; - -export const b = "b"; diff --git a/tests/testdata/bundle/file_tests-subdir-c.ts b/tests/testdata/bundle/file_tests-subdir-c.ts deleted file mode 100644 index 7cc01f993..000000000 --- a/tests/testdata/bundle/file_tests-subdir-c.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const c = "c"; -export default class C {} diff --git a/tests/testdata/bundle/file_tests-subdir-d.ts b/tests/testdata/bundle/file_tests-subdir-d.ts deleted file mode 100644 index 9f1ba7f67..000000000 --- a/tests/testdata/bundle/file_tests-subdir-d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { a } from "./a.ts"; - -export const d = { a }; diff --git a/tests/testdata/bundle/file_tests-subdir-e.ts b/tests/testdata/bundle/file_tests-subdir-e.ts deleted file mode 100644 index 55e8e0e18..000000000 --- a/tests/testdata/bundle/file_tests-subdir-e.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./a.ts"; diff --git a/tests/testdata/bundle/file_tests-subdir-f.ts b/tests/testdata/bundle/file_tests-subdir-f.ts deleted file mode 100644 index 8bc8d9bf4..000000000 --- a/tests/testdata/bundle/file_tests-subdir-f.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const isMain = import.meta.main; -export const modUrl = import.meta.url; diff --git a/tests/testdata/bundle/file_tests-subdir-g.ts b/tests/testdata/bundle/file_tests-subdir-g.ts deleted file mode 100644 index 3eb4cd3cc..000000000 --- a/tests/testdata/bundle/file_tests-subdir-g.ts +++ /dev/null @@ -1,12 +0,0 @@ -const g: number[] = []; - -export class G { - #g!: number[]; - constructor(shared: boolean) { - if (shared) { - this.#g = g; - } else { - this.#g = []; - } - } -} diff --git a/tests/testdata/bundle/file_tests-subdir-h.ts b/tests/testdata/bundle/file_tests-subdir-h.ts deleted file mode 100644 index 9c86dd5c5..000000000 --- a/tests/testdata/bundle/file_tests-subdir-h.ts +++ /dev/null @@ -1,12 +0,0 @@ -const g: number[] = []; - -export class H { - #g!: number[]; - constructor(shared: boolean) { - if (shared) { - this.#g = g; - } else { - this.#g = []; - } - } -} diff --git a/tests/testdata/bundle/file_tests-subdir-i.ts b/tests/testdata/bundle/file_tests-subdir-i.ts deleted file mode 100644 index 4ad9ce449..000000000 --- a/tests/testdata/bundle/file_tests-subdir-i.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function a(...d: string[]): string { - return d.join(" "); -} diff --git a/tests/testdata/bundle/file_tests-subdir-j.ts b/tests/testdata/bundle/file_tests-subdir-j.ts deleted file mode 100644 index ac7bce0ea..000000000 --- a/tests/testdata/bundle/file_tests-subdir-j.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function a(...d: string[]): string { - return d.join("/"); -} diff --git a/tests/testdata/bundle/file_tests-subdir-k.ts b/tests/testdata/bundle/file_tests-subdir-k.ts deleted file mode 100644 index 1b8a533f1..000000000 --- a/tests/testdata/bundle/file_tests-subdir-k.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as _i from "./i.ts"; -import * as _j from "./j.ts"; - -const k = globalThis.value ? _i : _j; - -export const i = _i; -export const j = _j; - -export const { - a, -} = k; diff --git a/tests/testdata/bundle/file_tests-subdir-l.ts b/tests/testdata/bundle/file_tests-subdir-l.ts deleted file mode 100644 index d767e6ad0..000000000 --- a/tests/testdata/bundle/file_tests-subdir-l.ts +++ /dev/null @@ -1 +0,0 @@ -export { a } from "./a.ts"; diff --git a/tests/testdata/bundle/file_tests-subdir-m.ts b/tests/testdata/bundle/file_tests-subdir-m.ts deleted file mode 100644 index 21e86d07c..000000000 --- a/tests/testdata/bundle/file_tests-subdir-m.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { a } from "./n.ts"; -export { O } from "./o.ts"; diff --git a/tests/testdata/bundle/file_tests-subdir-n.ts b/tests/testdata/bundle/file_tests-subdir-n.ts deleted file mode 100644 index ac3c37005..000000000 --- a/tests/testdata/bundle/file_tests-subdir-n.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function a() { - console.log("a"); -} diff --git a/tests/testdata/bundle/file_tests-subdir-o.ts b/tests/testdata/bundle/file_tests-subdir-o.ts deleted file mode 100644 index ab9753fea..000000000 --- a/tests/testdata/bundle/file_tests-subdir-o.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum O { - A, - B, - C, -} diff --git a/tests/testdata/bundle/file_tests-subdir-p.ts b/tests/testdata/bundle/file_tests-subdir-p.ts deleted file mode 100644 index 19b486f71..000000000 --- a/tests/testdata/bundle/file_tests-subdir-p.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./i.ts"; diff --git a/tests/testdata/bundle/file_tests-subdir-q.ts b/tests/testdata/bundle/file_tests-subdir-q.ts deleted file mode 100644 index eebe0a38b..000000000 --- a/tests/testdata/bundle/file_tests-subdir-q.ts +++ /dev/null @@ -1,13 +0,0 @@ -// deno-lint-ignore-file -export interface D { - resolve: any; - reject: any; -} - -export function d(): D { - let methods; - const promise = new Promise((resolve, reject) => { - methods = { resolve, reject }; - }); - return Object.assign(promise, methods); -} diff --git a/tests/testdata/bundle/fixture01.out b/tests/testdata/bundle/fixture01.out deleted file mode 100644 index a825140b7..000000000 --- a/tests/testdata/bundle/fixture01.out +++ /dev/null @@ -1,7 +0,0 @@ -const a = "a"; -const mod = function() { - return { - a: a - }; -}(); -console.log(mod); diff --git a/tests/testdata/bundle/fixture02.out b/tests/testdata/bundle/fixture02.out deleted file mode 100644 index 5c502e2f0..000000000 --- a/tests/testdata/bundle/fixture02.out +++ /dev/null @@ -1,12 +0,0 @@ -const c = "c"; -class C { -} -const mod = function() { - return { - default: C, - c: c - }; -}(); -const b = "b"; -console.log(b); -console.log(mod); diff --git a/tests/testdata/bundle/fixture03.out b/tests/testdata/bundle/fixture03.out deleted file mode 100644 index 524e77abb..000000000 --- a/tests/testdata/bundle/fixture03.out +++ /dev/null @@ -1,5 +0,0 @@ -const a = "a"; -const d = { - a -}; -console.log(d); diff --git a/tests/testdata/bundle/fixture04.out b/tests/testdata/bundle/fixture04.out deleted file mode 100644 index 37869205b..000000000 --- a/tests/testdata/bundle/fixture04.out +++ /dev/null @@ -1,2 +0,0 @@ -const a = await import("./subdir/a.ts"); -console.log(a); diff --git a/tests/testdata/bundle/fixture05.out b/tests/testdata/bundle/fixture05.out deleted file mode 100644 index 1289cca5f..000000000 --- a/tests/testdata/bundle/fixture05.out +++ /dev/null @@ -1,2 +0,0 @@ -const a = "a"; -console.log(a); diff --git a/tests/testdata/bundle/fixture06.out b/tests/testdata/bundle/fixture06.out deleted file mode 100644 index 47288d5e4..000000000 --- a/tests/testdata/bundle/fixture06.out +++ /dev/null @@ -1,12 +0,0 @@ -const importMeta = { - url: "file:///tests/subdir/f.ts", - main: false -}; -const isMain = importMeta.main; -const modUrl = importMeta.url; -const importMeta1 = { - url: "file:///tests/fixture06.ts", - main: import.meta.main -}; -console.log(isMain, modUrl); -console.log(importMeta1.main, importMeta1.url); diff --git a/tests/testdata/bundle/fixture07.out b/tests/testdata/bundle/fixture07.out deleted file mode 100644 index 39e6a11e8..000000000 --- a/tests/testdata/bundle/fixture07.out +++ /dev/null @@ -1,23 +0,0 @@ -const g = []; -class G { - #g; - constructor(shared){ - if (shared) { - this.#g = g; - } else { - this.#g = []; - } - } -} -const g1 = []; -class H { - #g; - constructor(shared1){ - if (shared1) { - this.#g = g1; - } else { - this.#g = []; - } - } -} -console.log(new G(true), new H(true)); diff --git a/tests/testdata/bundle/fixture08.out b/tests/testdata/bundle/fixture08.out deleted file mode 100644 index bfe40aa37..000000000 --- a/tests/testdata/bundle/fixture08.out +++ /dev/null @@ -1,7 +0,0 @@ -const a1 = "a"; -const mod = function() { - return { - a: a1 - }; -}(); -export { mod as a }; diff --git a/tests/testdata/bundle/fixture09.out b/tests/testdata/bundle/fixture09.out deleted file mode 100644 index e06cc92de..000000000 --- a/tests/testdata/bundle/fixture09.out +++ /dev/null @@ -1,19 +0,0 @@ -function a3(...d) { - return d.join(" "); -} -const mod = function() { - return { - a: a3 - }; -}(); -function a1(...d) { - return d.join("/"); -} -const mod1 = function() { - return { - a: a1 - }; -}(); -const k = globalThis.value ? mod : mod1; -const { a: a2 , } = k; -export { a2 as a }; diff --git a/tests/testdata/bundle/fixture10.out b/tests/testdata/bundle/fixture10.out deleted file mode 100644 index 5491e5e7f..000000000 --- a/tests/testdata/bundle/fixture10.out +++ /dev/null @@ -1,5 +0,0 @@ -const a = "a"; -const o = { -}; -const { a: a1 = a } = o; -console.log(a1); diff --git a/tests/testdata/bundle/fixture11.out b/tests/testdata/bundle/fixture11.out deleted file mode 100644 index 4f333a513..000000000 --- a/tests/testdata/bundle/fixture11.out +++ /dev/null @@ -1,30 +0,0 @@ -function a() { - console.log("a"); -} -var O1; -(function(O) { - O[O["A"] = 0] = "A"; - O[O["B"] = 1] = "B"; - O[O["C"] = 2] = "C"; -})(O1 || (O1 = { -})); -export { O1 as O }; -class A { - #a; - #c; - constructor(o = { - }){ - const { a: a1 = a , c , } = o; - this.#a = a1; - this.#c = c; - } - a() { - this.#a(); - } - c() { - console.log(this.#c); - } -} -const a2 = new A(); -a2.a(); -a2.c(); diff --git a/tests/testdata/bundle/fixture12.out b/tests/testdata/bundle/fixture12.out deleted file mode 100644 index 64e2d6cdb..000000000 --- a/tests/testdata/bundle/fixture12.out +++ /dev/null @@ -1,7 +0,0 @@ -function a(...d) { - return d.join(" "); -} -function b() { - a(); -} -b(); diff --git a/tests/testdata/bundle/fixture13.out b/tests/testdata/bundle/fixture13.out deleted file mode 100644 index 1c7a8c991..000000000 --- a/tests/testdata/bundle/fixture13.out +++ /dev/null @@ -1,17 +0,0 @@ -function d() { - let methods; - const promise = new Promise((resolve, reject)=>{ - methods = { - resolve, - reject - }; - }); - return Object.assign(promise, methods); -} -class A { - s = d(); - a() { - this.s.resolve(); - } -} -new A(); diff --git a/tests/testdata/bundle/fixture14.out b/tests/testdata/bundle/fixture14.out deleted file mode 100644 index 392bb6478..000000000 --- a/tests/testdata/bundle/fixture14.out +++ /dev/null @@ -1,2 +0,0 @@ -const mod = []; -console.log(mod); diff --git a/tests/testdata/bundle/fixture15.out b/tests/testdata/bundle/fixture15.out deleted file mode 100644 index dc72fdeff..000000000 --- a/tests/testdata/bundle/fixture15.out +++ /dev/null @@ -1,4 +0,0 @@ -function getIndex1(c) { - return "\x00\r\n\x85\u2028\u2029".indexOf(c); -} -export { getIndex1 as getIndex }; diff --git a/tests/testdata/bundle/fixture16.out b/tests/testdata/bundle/fixture16.out deleted file mode 100644 index 5e21c2a71..000000000 --- a/tests/testdata/bundle/fixture16.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD] -const a = "a"; -export { a as test1 }; -export { a as test2 }; -console.log(a); - diff --git a/tests/testdata/bundle/https_deno.land-x-lib-a.ts b/tests/testdata/bundle/https_deno.land-x-lib-a.ts deleted file mode 100644 index a0a6f8e94..000000000 --- a/tests/testdata/bundle/https_deno.land-x-lib-a.ts +++ /dev/null @@ -1 +0,0 @@ -export const a: string[] = []; diff --git a/tests/testdata/bundle/https_deno.land-x-lib-b.js b/tests/testdata/bundle/https_deno.land-x-lib-b.js deleted file mode 100644 index 13cacdd8b..000000000 --- a/tests/testdata/bundle/https_deno.land-x-lib-b.js +++ /dev/null @@ -1 +0,0 @@ -export const b = []; diff --git a/tests/testdata/bundle/https_deno.land-x-lib-c.d.ts b/tests/testdata/bundle/https_deno.land-x-lib-c.d.ts deleted file mode 100644 index fac988e49..000000000 --- a/tests/testdata/bundle/https_deno.land-x-lib-c.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const c: string[]; diff --git a/tests/testdata/bundle/https_deno.land-x-lib-c.js b/tests/testdata/bundle/https_deno.land-x-lib-c.js deleted file mode 100644 index 620ca0b66..000000000 --- a/tests/testdata/bundle/https_deno.land-x-lib-c.js +++ /dev/null @@ -1,3 +0,0 @@ -/// <reference types="./c.d.ts" /> - -export const c = []; diff --git a/tests/testdata/bundle/https_deno.land-x-lib-mod.d.ts b/tests/testdata/bundle/https_deno.land-x-lib-mod.d.ts deleted file mode 100644 index 76ed81df0..000000000 --- a/tests/testdata/bundle/https_deno.land-x-lib-mod.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * as a from "./a.ts"; -export * as b from "./b.js"; -export * as c from "./c.js"; - -export interface A { - a: string; -} - -export const mod: A[]; diff --git a/tests/testdata/bundle/https_deno.land-x-lib-mod.js b/tests/testdata/bundle/https_deno.land-x-lib-mod.js deleted file mode 100644 index 505162094..000000000 --- a/tests/testdata/bundle/https_deno.land-x-lib-mod.js +++ /dev/null @@ -1,5 +0,0 @@ -export * as a from "./a.ts"; -export * as b from "./b.js"; -export * as c from "./c.js"; - -export const mod = []; diff --git a/tests/testdata/bundle/ignore_directives.test.out b/tests/testdata/bundle/ignore_directives.test.out deleted file mode 100644 index b69c2632c..000000000 --- a/tests/testdata/bundle/ignore_directives.test.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD] -// deno-fmt-ignore-file -// deno-lint-ignore-file -// This code was bundled using `deno bundle` and it's not recommended to edit it manually - -[WILDCARD] diff --git a/tests/testdata/bundle/import_map/import_map.json b/tests/testdata/bundle/import_map/import_map.json deleted file mode 100644 index c02f72718..000000000 --- a/tests/testdata/bundle/import_map/import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "mod2": "../../subdir/subdir2/mod2.ts" - } -} diff --git a/tests/testdata/bundle/import_map/main.ts b/tests/testdata/bundle/import_map/main.ts deleted file mode 100644 index 74834de20..000000000 --- a/tests/testdata/bundle/import_map/main.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { printHello2, returnsFoo } from "mod2"; - -export function returnsHi(): string { - return "Hi"; -} - -export function returnsFoo2(): string { - return returnsFoo(); -} - -export function printHello3() { - printHello2(); -} - -export function throwsError() { - throw Error("exception from mod1"); -} diff --git a/tests/testdata/bundle/jsx.out b/tests/testdata/bundle/jsx.out deleted file mode 100644 index da83cde82..000000000 --- a/tests/testdata/bundle/jsx.out +++ /dev/null @@ -1,9 +0,0 @@ -[WILDCARD] -const React = { - createElement () {} -}; -function app() { - return React.createElement("div", null, React.createElement("h2", null, "asdf")); -} -console.log(app); - diff --git a/tests/testdata/bundle/shebang_file.bundle.out b/tests/testdata/bundle/shebang_file.bundle.out deleted file mode 100644 index d3369bc9c..000000000 --- a/tests/testdata/bundle/shebang_file.bundle.out +++ /dev/null @@ -1,12 +0,0 @@ -⚠️ Warning: `deno bundle` is deprecated and will be removed in Deno 2.0. -Use an alternative bundler like "deno_emit", "esbuild" or "rollup" instead. -Bundle file:///[WILDCARD]/subdir/shebang_file.js -#!/usr/bin/env -S deno run --allow-read -// deno-fmt-ignore-file -// deno-lint-ignore-file -// This code was bundled using `deno bundle` and it's not recommended to edit it manually - -for (const item of Deno.readDirSync(".")){ - console.log(item.name); -} - diff --git a/tests/testdata/check/jsximportsource_importmap_config/main.bundle.js b/tests/testdata/check/jsximportsource_importmap_config/main.bundle.js deleted file mode 100644 index 6f39c876e..000000000 --- a/tests/testdata/check/jsximportsource_importmap_config/main.bundle.js +++ /dev/null @@ -1,9 +0,0 @@ -// 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 }; - |