From da52058a945999d486b07700d2834f027a65947c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 29 Apr 2024 10:08:27 -0400 Subject: chore: migrate bench, publish, and more itests to spec tests (#23584) --- tests/Cargo.toml | 2 +- tests/integration/bench_tests.rs | 237 ----------------- tests/integration/cache_tests.rs | 72 ----- tests/integration/check_tests.rs | 31 --- tests/integration/doc_tests.rs | 15 -- tests/integration/info_tests.rs | 15 -- tests/integration/lint_tests.rs | 42 --- tests/integration/publish_tests.rs | 296 ++------------------- tests/integration/run_tests.rs | 49 ---- tests/integration/test_tests.rs | 21 -- tests/specs/README.md | 1 + tests/specs/bench/allow_all/__test__.jsonc | 5 + tests/specs/bench/allow_all/allow_all.out | 23 ++ tests/specs/bench/allow_all/allow_all.ts | 43 +++ tests/specs/bench/allow_none/__test__.jsonc | 5 + tests/specs/bench/allow_none/allow_none.out | 22 ++ tests/specs/bench/allow_none/allow_none.ts | 21 ++ .../before_unload_prevent_default/__test__.jsonc | 4 + .../before_unload_prevent_default.out | 7 + .../before_unload_prevent_default.ts | 6 + .../bench/bench_explicit_start_end/__test__.jsonc | 5 + .../explicit_start_and_end.out | 25 ++ .../explicit_start_and_end.ts | 50 ++++ tests/specs/bench/bench_formatting/__test__.jsonc | 5 + .../bench/bench_formatting/bench_formatting.out | 8 + .../bench/bench_formatting/bench_formatting.ts | 3 + .../bench/check_local_by_default/__test__.jsonc | 4 + .../check_local_by_default.out | 6 + .../check_local_by_default.ts | 3 + .../bench/check_local_by_default2/__test__.jsonc | 5 + .../check_local_by_default2.out | 4 + .../check_local_by_default2.ts | 6 + tests/specs/bench/clear_timeout/__test__.jsonc | 5 + tests/specs/bench/clear_timeout/clear_timeout.out | 10 + tests/specs/bench/clear_timeout/clear_timeout.ts | 5 + tests/specs/bench/collect/__test__.jsonc | 19 ++ tests/specs/bench/collect/collect.out | 18 ++ tests/specs/bench/collect/collect/bench.ts | 0 tests/specs/bench/collect/collect/deno.jsonc | 5 + .../bench/collect/collect/deno.malformed.jsonc | 5 + tests/specs/bench/collect/collect/deno2.jsonc | 6 + tests/specs/bench/collect/collect/ignore/bench.ts | 1 + .../specs/bench/collect/collect/include/2_bench.ts | 0 tests/specs/bench/collect/collect/include/bench.ts | 0 tests/specs/bench/collect/collect2.out | 13 + .../collect/collect_with_malformed_config.out | 4 + tests/specs/bench/exit_sanitizer/__test__.jsonc | 5 + .../specs/bench/exit_sanitizer/exit_sanitizer.out | 14 + tests/specs/bench/exit_sanitizer/exit_sanitizer.ts | 11 + .../__test__.jsonc | 5 + .../main.bench.out | 10 + .../main.bench.ts | 4 + tests/specs/bench/fail/__test__.jsonc | 5 + tests/specs/bench/fail/fail.out | 28 ++ tests/specs/bench/fail/fail.ts | 30 +++ tests/specs/bench/filter/__test__.jsonc | 4 + tests/specs/bench/filter/a_bench.ts | 3 + tests/specs/bench/filter/b_bench.ts | 3 + tests/specs/bench/filter/c_bench.ts | 3 + tests/specs/bench/filter/filter.out | 20 ++ tests/specs/bench/filter_group_header/main.out | 4 +- tests/specs/bench/finally_timeout/__test__.jsonc | 5 + .../bench/finally_timeout/finally_timeout.out | 11 + .../specs/bench/finally_timeout/finally_timeout.ts | 11 + tests/specs/bench/group_baseline/__test__.jsonc | 5 + .../specs/bench/group_baseline/group_baseline.out | 20 ++ tests/specs/bench/group_baseline/group_baseline.ts | 15 ++ tests/specs/bench/ignore/__test__.jsonc | 5 + tests/specs/bench/ignore/ignore.out | 8 + tests/specs/bench/ignore/ignore.ts | 9 + .../specs/bench/ignore_permissions/__test__.jsonc | 5 + .../ignore_permissions/ignore_permissions.out | 8 + .../bench/ignore_permissions/ignore_permissions.ts | 16 ++ tests/specs/bench/interval/__test__.jsonc | 5 + tests/specs/bench/interval/interval.out | 8 + tests/specs/bench/interval/interval.ts | 1 + tests/specs/bench/json_output/__test__.jsonc | 5 + tests/specs/bench/json_output/pass.json.out | 28 ++ tests/specs/bench/json_output/pass.ts | 10 + tests/specs/bench/load_unload/__test__.jsonc | 5 + tests/specs/bench/load_unload/load_unload.out | 8 + tests/specs/bench/load_unload/load_unload.ts | 22 ++ tests/specs/bench/meta/__test__.jsonc | 5 + tests/specs/bench/meta/meta.out | 10 + tests/specs/bench/meta/meta.ts | 2 + tests/specs/bench/multifile_summary/__test__.jsonc | 5 + .../bench/multifile_summary/group_baseline.ts | 15 ++ .../bench/multifile_summary/multifile_summary.out | 64 +++++ .../bench/multifile_summary/multiple_group.ts | 15 ++ tests/specs/bench/multifile_summary/pass.ts | 10 + tests/specs/bench/no_check/__test__.jsonc | 5 + tests/specs/bench/no_check/no_check.out | 9 + tests/specs/bench/no_check/no_check.ts | 1 + .../bench/no_prompt_by_default/__test__.jsonc | 5 + .../no_prompt_by_default/no_prompt_by_default.out | 9 + .../no_prompt_by_default/no_prompt_by_default.ts | 3 + .../no_prompt_with_denied_perms/__test__.jsonc | 5 + .../no_prompt_with_denied_perms.out | 9 + .../no_prompt_with_denied_perms.ts | 3 + tests/specs/bench/no_run/__test__.jsonc | 5 + tests/specs/bench/no_run/no_run.out | 5 + tests/specs/bench/no_run/no_run.ts | 2 + tests/specs/bench/only/__test__.jsonc | 5 + tests/specs/bench/only/only.out | 9 + tests/specs/bench/only/only.ts | 15 ++ tests/specs/bench/overloads/__test__.jsonc | 5 + tests/specs/bench/overloads/overloads.out | 12 + tests/specs/bench/overloads/overloads.ts | 6 + tests/specs/bench/package_json/__test__.jsonc | 5 + tests/specs/bench/package_json/lib.bench.out | 11 + tests/specs/bench/package_json/lib.bench.ts | 7 + tests/specs/bench/package_json/lib.ts | 9 + tests/specs/bench/package_json/package.json | 5 + tests/specs/bench/pass/__test__.jsonc | 5 + tests/specs/bench/pass/pass.out | 17 ++ tests/specs/bench/pass/pass.ts | 10 + tests/specs/bench/quiet/__test__.jsonc | 5 + tests/specs/bench/quiet/quiet.out | 10 + tests/specs/bench/quiet/quiet.ts | 15 ++ .../specs/bench/unhandled_rejection/__test__.jsonc | 5 + .../unhandled_rejection/unhandled_rejection.out | 11 + .../unhandled_rejection/unhandled_rejection.ts | 3 + .../specs/bench/unresolved_promise/__test__.jsonc | 5 + .../unresolved_promise/unresolved_promise.out | 9 + .../bench/unresolved_promise/unresolved_promise.ts | 1 + .../cache/check_local_by_default/__test__.jsonc | 4 + .../check_local_by_default.out | 0 .../check_local_by_default.ts | 3 + .../cache/check_local_by_default2/__test__.jsonc | 4 + .../check_local_by_default2.out | 0 .../check_local_by_default2.ts | 6 + tests/specs/cache/extensionless/__test__.jsonc | 4 + .../cache/extensionless/cache_extensionless.out | 2 + tests/specs/cache/fetch_multiple/__test__.jsonc | 4 + .../specs/cache/fetch_multiple/fetch_multiple.out | 5 + tests/specs/cache/fetch_multiple/other.ts | 1 + tests/specs/cache/fetch_multiple/test.ts | 1 + tests/specs/cache/ignore_require/__test__.jsonc | 4 + tests/specs/cache/ignore_require/ignore_require.js | 2 + tests/specs/cache/json_import/__test__.jsonc | 5 + tests/specs/cache/json_import/main.ts | 2 + tests/specs/cache/json_import/test.json | 5 + tests/specs/cache/package_json/__test__.jsonc | 5 + tests/specs/cache/package_json/lib.ts | 9 + tests/specs/cache/package_json/main.cache.out | 3 + tests/specs/cache/package_json/main.ts | 3 + tests/specs/cache/package_json/package.json | 5 + tests/specs/cache/performance_stats/__test__.jsonc | 4 + tests/specs/cache/performance_stats/hello.ts | 1 + .../cache/performance_stats/performance_stats.out | 16 ++ tests/specs/cache/random_extension/__test__.jsonc | 4 + .../random_extension/cache_random_extension.out | 2 + tests/specs/cache/redirect/__test__.jsonc | 4 + tests/specs/cache/redirect/redirect_cache.out | 5 + .../with_bare_import/095_cache_with_bare_import.ts | 1 + .../095_cache_with_bare_import.ts.out | 2 + tests/specs/cache/with_bare_import/__test__.jsonc | 5 + tests/specs/check/check_types_dts/__test__.jsonc | 5 + tests/specs/check/check_types_dts/deno.json | 7 + tests/specs/check/check_types_dts/main.out | 1 + tests/specs/check/check_types_dts/main.ts | 3 + tests/specs/check/check_types_dts/types.d.ts | 3 + .../__test__.jsonc | 4 + .../check_with_excluded_file_specified/check.out | 1 + .../check_with_excluded_file_specified/deno.json | 6 + .../lib/types.d.ts | 2 + tests/specs/check/extensionless/__test__.jsonc | 4 + tests/specs/check/extensionless/check.out | 2 + tests/specs/check/random_extension/__test__.jsonc | 4 + tests/specs/check/random_extension/output.out | 2 + .../with_bare_import/095_cache_with_bare_import.ts | 1 + .../095_cache_with_bare_import.ts.out | 2 + tests/specs/check/with_bare_import/__test__.jsonc | 5 + tests/specs/lint/no_slow_types/__test__.jsonc | 17 ++ tests/specs/lint/no_slow_types/a.ts | 3 + tests/specs/lint/no_slow_types/b.ts | 5 + tests/specs/lint/no_slow_types/c.ts | 4 + tests/specs/lint/no_slow_types/d.ts | 4 + tests/specs/lint/no_slow_types/deno.json | 8 + .../specs/lint/no_slow_types/deno.non-package.json | 2 + tests/specs/lint/no_slow_types/no_slow_types.out | 35 +++ .../no_slow_types/no_slow_types_entrypoint.out | 35 +++ .../lint/no_slow_types_entrypoint/__test__.jsonc | 5 + tests/specs/lint/no_slow_types_entrypoint/a.ts | 3 + tests/specs/lint/no_slow_types_entrypoint/b.ts | 5 + tests/specs/lint/no_slow_types_entrypoint/c.ts | 4 + tests/specs/lint/no_slow_types_entrypoint/d.ts | 4 + .../specs/lint/no_slow_types_entrypoint/deno.json | 8 + .../no_slow_types_entrypoint/deno.non-package.json | 2 + .../no_slow_types_entrypoint/no_slow_types.out | 35 +++ .../no_slow_types_entrypoint.out | 35 +++ .../lint/no_slow_types_workspace/__test__.jsonc | 5 + tests/specs/lint/no_slow_types_workspace/a/b.ts | 5 + tests/specs/lint/no_slow_types_workspace/a/d.ts | 4 + .../specs/lint/no_slow_types_workspace/a/deno.json | 8 + tests/specs/lint/no_slow_types_workspace/a/mod.ts | 3 + .../specs/lint/no_slow_types_workspace/b/deno.json | 5 + tests/specs/lint/no_slow_types_workspace/b/mod.ts | 4 + .../specs/lint/no_slow_types_workspace/c/deno.json | 5 + .../specs/lint/no_slow_types_workspace/c/mod_c.ts | 4 + tests/specs/lint/no_slow_types_workspace/deno.json | 7 + .../specs/lint/no_slow_types_workspace/output.out | 46 ++++ tests/specs/lockfile/no_lock/__test__.jsonc | 31 +++ tests/specs/lockfile/no_lock/bench.nolock.out | 5 + tests/specs/lockfile/no_lock/deno.json | 5 + tests/specs/lockfile/no_lock/deno.lock | 6 + tests/specs/lockfile/no_lock/doc.nolock.out | 0 tests/specs/lockfile/no_lock/fail.out | 3 + tests/specs/lockfile/no_lock/fail_initial.out | 4 + tests/specs/lockfile/no_lock/info.nolock.out | 7 + tests/specs/lockfile/no_lock/main.bench.ts | 8 + tests/specs/lockfile/no_lock/main.test.ts | 8 + tests/specs/lockfile/no_lock/main.ts | 3 + tests/specs/lockfile/no_lock/test.nolock.out | 3 + tests/specs/mod.rs | 79 ++++-- .../specs/publish/allow_slow_types/__test__.jsonc | 5 + .../publish/allow_slow_types/allow_slow_types.out | 5 + tests/specs/publish/allow_slow_types/deno.json | 7 + tests/specs/publish/allow_slow_types/mod.ts | 4 + .../publish/bare_node_builtins/__test__.jsonc | 17 ++ .../bare_node_builtins/bare_node_builtins.out | 11 + tests/specs/publish/bare_node_builtins/deno.json | 7 + tests/specs/publish/bare_node_builtins/mod.ts | 5 + .../publish/bare_node_builtins/no_warnings.out | 5 + .../specs/publish/config_file_jsonc/__test__.jsonc | 4 + tests/specs/publish/config_file_jsonc/deno.jsonc | 11 + .../specs/publish/config_file_jsonc/deno_jsonc.out | 6 + tests/specs/publish/config_file_jsonc/mod.ts | 7 + tests/specs/publish/config_file_jsonc/std_http.ts | 6 + tests/specs/publish/config_flag/__test__.jsonc | 4 + tests/specs/publish/config_flag/successful.out | 6 + .../specs/publish/config_flag/successful/deno.json | 10 + tests/specs/publish/config_flag/successful/mod.ts | 7 + .../publish/config_flag/successful/std_http.ts | 6 + tests/specs/publish/dry_run/__test__.jsonc | 4 + tests/specs/publish/dry_run/deno.json | 10 + tests/specs/publish/dry_run/dry_run.out | 8 + tests/specs/publish/dry_run/mod.ts | 7 + tests/specs/publish/dry_run/std_http.ts | 6 + tests/specs/publish/has_slow_types/__test__.jsonc | 5 + tests/specs/publish/has_slow_types/deno.json | 7 + .../publish/has_slow_types/has_slow_types.out | 22 ++ tests/specs/publish/has_slow_types/mod.ts | 4 + tests/specs/publish/invalid_import/__test__.jsonc | 5 + tests/specs/publish/invalid_import/deno.json | 10 + .../publish/invalid_import/invalid_import.out | 32 +++ tests/specs/publish/invalid_import/mod.ts | 9 + .../__test__.jsonc | 5 + .../invalid_import_esm_sh_suggestion/deno.json | 10 + .../invalid_import_esm_sh_suggestion.out | 20 ++ .../invalid_import_esm_sh_suggestion/mod.ts | 5 + tests/specs/publish/invalid_path/__test__.jsonc | 5 + tests/specs/publish/invalid_path/deno.json | 7 + tests/specs/publish/invalid_path/invalid_path.out | 11 + tests/specs/publish/invalid_path/mod.ts | 3 + .../publish/invalid_path/path with spaces.txt | 0 .../publish/javascript_decl_file/__test__.jsonc | 5 + tests/specs/publish/javascript_decl_file/deno.json | 7 + .../javascript_decl_file/javascript_decl_file.out | 5 + tests/specs/publish/javascript_decl_file/mod.d.ts | 1 + tests/specs/publish/javascript_decl_file/mod.js | 5 + .../javascript_missing_decl_file/__test__.jsonc | 5 + .../publish/javascript_missing_decl_file/deno.json | 8 + .../javascript_missing_decl_file.out | 20 ++ .../publish/javascript_missing_decl_file/mod.js | 3 + .../publish/javascript_missing_decl_file/other.js | 3 + tests/specs/publish/jsr_jsonc/__test__.jsonc | 4 + tests/specs/publish/jsr_jsonc/jsr.jsonc | 11 + tests/specs/publish/jsr_jsonc/mod.out | 6 + tests/specs/publish/jsr_jsonc/mod.ts | 7 + tests/specs/publish/jsr_jsonc/std_http.ts | 6 + .../specs/publish/missing_deno_json/__test__.jsonc | 5 + tests/specs/publish/missing_deno_json/main.ts | 3 + .../missing_deno_json/missing_deno_json.out | 1 + tests/specs/publish/no_check/__test__.jsonc | 4 + tests/specs/publish/no_check/deno.json | 10 + tests/specs/publish/no_check/mod.ts | 7 + tests/specs/publish/no_check/std_http.ts | 6 + .../specs/publish/no_check/successful_no_check.out | 4 + tests/specs/publish/no_token/__test__.jsonc | 5 + tests/specs/publish/no_token/main.ts | 3 + tests/specs/publish/no_token/no_token.out | 1 + tests/specs/publish/node_specifier/__test__.jsonc | 4 + tests/specs/publish/node_specifier/deno.json | 7 + tests/specs/publish/node_specifier/mod.ts | 5 + .../publish/node_specifier/node_specifier.out | 8 + tests/specs/publish/package_json/__test__.jsonc | 4 + tests/specs/publish/package_json/deno.json | 8 + tests/specs/publish/package_json/mod.ts | 9 + tests/specs/publish/package_json/package.json | 7 + tests/specs/publish/package_json/package_json.out | 8 + tests/specs/publish/sloppy_imports/__test__.jsonc | 21 ++ tests/specs/publish/sloppy_imports/b/index.ts | 1 + tests/specs/publish/sloppy_imports/deno.json | 7 + tests/specs/publish/sloppy_imports/mod.ts | 1 + .../publish/sloppy_imports/sloppy_imports.out | 10 + .../sloppy_imports/sloppy_imports_no_warnings.out | 6 + .../sloppy_imports/sloppy_imports_not_enabled.out | 2 + tests/specs/publish/successful/__test__.jsonc | 4 + tests/specs/publish/successful/deno.json | 10 + tests/specs/publish/successful/mod.ts | 7 + tests/specs/publish/successful/std_http.ts | 6 + tests/specs/publish/successful/successful.out | 6 + tests/specs/publish/symlink/__test__.jsonc | 15 ++ tests/specs/publish/symlink/deno.json | 7 + tests/specs/publish/symlink/mod.ts | 3 + tests/specs/publish/symlink/symlink.out | 15 ++ .../unanalyzable_dynamic_import/__test__.jsonc | 5 + .../publish/unanalyzable_dynamic_import/deno.json | 7 + .../publish/unanalyzable_dynamic_import/mod.ts | 2 + .../unanalyzable_dynamic_import.out | 16 ++ .../publish/unsupported_jsx_tsx/__test__.jsonc | 4 + tests/specs/publish/unsupported_jsx_tsx/foo.jsx | 5 + tests/specs/publish/unsupported_jsx_tsx/foo.tsx | 5 + tests/specs/publish/unsupported_jsx_tsx/jsr.jsonc | 11 + tests/specs/publish/unsupported_jsx_tsx/mod.out | 17 ++ tests/specs/publish/unsupported_jsx_tsx/mod.ts | 7 + tests/specs/publish/workspace/__test__.jsonc | 10 + tests/specs/publish/workspace/bar/deno.json | 7 + tests/specs/publish/workspace/bar/mod.ts | 3 + tests/specs/publish/workspace/deno.json | 6 + tests/specs/publish/workspace/foo/deno.json | 10 + tests/specs/publish/workspace/foo/mod.ts | 5 + tests/specs/publish/workspace/workspace.out | 12 + .../publish/workspace/workspace_individual.out | 6 + tests/specs/run/no_deno_json/__test__.jsonc | 36 +++ tests/specs/run/no_deno_json/code/main.ts | 4 + .../no_deno_json/code/no_package_json_imports.ts | 1 + tests/specs/run/no_deno_json/code/noconfig.ts | 8 + tests/specs/run/no_deno_json/code/package.json | 9 + tests/specs/run/no_deno_json/code/sub_dir/main.js | 3 + tests/specs/run/no_deno_json/code/sub_dir/main.out | 7 + tests/specs/run/no_deno_json/main.out | 4 + .../run/no_deno_json/no_package_json_imports.out | 1 + tests/specs/run/no_deno_json/noconfig.out | 4 + tests/specs/schema.json | 3 + .../__test__.jsonc | 4 + .../include_relative_pattern_dot_slash/deno.json | 7 + .../include_relative_pattern_dot_slash/output.out | 5 + .../test/add.mjs | 3 + .../test/add.test.mjs | 7 + tests/testdata/bench/allow_all.ts | 43 --- tests/testdata/bench/allow_none.ts | 23 -- .../bench/before_unload_prevent_default.ts | 6 - tests/testdata/bench/bench_formatting.ts | 3 - tests/testdata/bench/check_local_by_default.ts | 3 - tests/testdata/bench/check_local_by_default2.ts | 6 - tests/testdata/bench/clear_timeout.ts | 5 - tests/testdata/bench/collect.out | 18 -- tests/testdata/bench/collect/bench.ts | 0 tests/testdata/bench/collect/deno.jsonc | 5 - tests/testdata/bench/collect/deno.malformed.jsonc | 5 - tests/testdata/bench/collect/deno2.jsonc | 6 - tests/testdata/bench/collect/ignore/bench.ts | 1 - tests/testdata/bench/collect/include/2_bench.ts | 0 tests/testdata/bench/collect/include/bench.ts | 0 tests/testdata/bench/collect2.out | 13 - .../bench/collect_with_malformed_config.out | 4 - tests/testdata/bench/exit_sanitizer.ts | 11 - tests/testdata/bench/explicit_start_and_end.ts | 50 ---- .../bench/explicit_start_and_end_low_precision.out | 10 - .../bench/explicit_start_and_end_low_precision.ts | 4 - tests/testdata/bench/fail.ts | 30 --- tests/testdata/bench/filter.out | 20 -- tests/testdata/bench/filter/a_bench.ts | 3 - tests/testdata/bench/filter/b_bench.ts | 3 - tests/testdata/bench/filter/c_bench.ts | 3 - tests/testdata/bench/finally_timeout.ts | 11 - tests/testdata/bench/group_baseline.ts | 15 -- tests/testdata/bench/ignore.ts | 9 - tests/testdata/bench/ignore_permissions.ts | 16 -- tests/testdata/bench/interval.ts | 1 - tests/testdata/bench/load_unload.ts | 22 -- tests/testdata/bench/meta.ts | 2 - tests/testdata/bench/multiple_group.ts | 15 -- tests/testdata/bench/no_check.ts | 1 - tests/testdata/bench/no_prompt_by_default.ts | 3 - .../testdata/bench/no_prompt_with_denied_perms.ts | 3 - tests/testdata/bench/no_run.ts | 2 - tests/testdata/bench/only.ts | 15 -- tests/testdata/bench/overloads.ts | 6 - tests/testdata/bench/pass.ts | 10 - tests/testdata/bench/quiet.ts | 15 -- tests/testdata/bench/unhandled_rejection.ts | 3 - tests/testdata/bench/unresolved_promise.ts | 1 - tests/testdata/cache/095_cache_with_bare_import.ts | 1 - tests/testdata/cache/cache_extensionless.out | 2 - tests/testdata/cache/cache_random_extension.out | 2 - tests/testdata/cache/check_local_by_default.ts | 3 - tests/testdata/cache/check_local_by_default2.ts | 6 - tests/testdata/cache/ignore_require.js | 2 - tests/testdata/cache/json_import/main.ts | 2 - tests/testdata/cache/json_import/test.json | 5 - tests/testdata/cache/redirect_cache.out | 5 - .../check/excluded_file_specified/check.out | 1 - .../check/excluded_file_specified/deno.json | 6 - .../check/excluded_file_specified/lib/types.d.ts | 2 - tests/testdata/check/types_dts/deno.json | 7 - tests/testdata/check/types_dts/main.out | 1 - tests/testdata/check/types_dts/main.ts | 3 - tests/testdata/check/types_dts/types.d.ts | 3 - tests/testdata/lint/no_slow_types/a.ts | 3 - tests/testdata/lint/no_slow_types/b.ts | 5 - tests/testdata/lint/no_slow_types/c.ts | 4 - tests/testdata/lint/no_slow_types/d.ts | 4 - tests/testdata/lint/no_slow_types/deno.json | 8 - .../lint/no_slow_types/deno.non-package.json | 2 - .../testdata/lint/no_slow_types/no_slow_types.out | 35 --- .../no_slow_types/no_slow_types_entrypoint.out | 35 --- tests/testdata/lint/no_slow_types_workspace/a/b.ts | 5 - tests/testdata/lint/no_slow_types_workspace/a/d.ts | 4 - .../lint/no_slow_types_workspace/a/deno.json | 8 - .../testdata/lint/no_slow_types_workspace/a/mod.ts | 3 - .../lint/no_slow_types_workspace/b/deno.json | 5 - .../testdata/lint/no_slow_types_workspace/b/mod.ts | 4 - .../lint/no_slow_types_workspace/c/deno.json | 5 - .../lint/no_slow_types_workspace/c/mod_c.ts | 4 - .../lint/no_slow_types_workspace/deno.json | 7 - .../lint/no_slow_types_workspace/output.out | 46 ---- tests/testdata/lockfile/basic/bench.nolock.out | 6 - tests/testdata/lockfile/basic/deno.json | 5 - tests/testdata/lockfile/basic/deno.lock | 6 - tests/testdata/lockfile/basic/doc.nolock.out | 1 - tests/testdata/lockfile/basic/fail.out | 4 - tests/testdata/lockfile/basic/info.nolock.out | 8 - tests/testdata/lockfile/basic/main.bench.ts | 8 - tests/testdata/lockfile/basic/main.test.ts | 8 - tests/testdata/lockfile/basic/main.ts | 3 - tests/testdata/lockfile/basic/test.nolock.out | 4 - tests/testdata/package_json/basic/lib.bench.out | 11 - tests/testdata/package_json/basic/lib.bench.ts | 7 - tests/testdata/package_json/basic/main.cache.out | 3 - tests/testdata/publish/allow_slow_types.out | 5 - tests/testdata/publish/bare_node_builtins.out | 11 - .../testdata/publish/bare_node_builtins/deno.json | 7 - tests/testdata/publish/bare_node_builtins/mod.ts | 5 - .../publish/bare_node_builtins_no_warnings.out | 9 - tests/testdata/publish/deno_jsonc.out | 6 - tests/testdata/publish/deno_jsonc/deno.jsonc | 11 - tests/testdata/publish/deno_jsonc/mod.ts | 7 - tests/testdata/publish/deno_jsonc/std_http.ts | 6 - tests/testdata/publish/dry_run.out | 8 - tests/testdata/publish/has_slow_types.out | 22 -- tests/testdata/publish/has_slow_types/deno.json | 7 - tests/testdata/publish/has_slow_types/mod.ts | 4 - tests/testdata/publish/invalid_import.out | 32 --- tests/testdata/publish/invalid_import/deno.json | 10 - tests/testdata/publish/invalid_import/mod.ts | 9 - .../publish/invalid_import_esm_sh_suggestion.out | 20 -- .../invalid_import_esm_sh_suggestion/deno.json | 10 - .../invalid_import_esm_sh_suggestion/mod.ts | 5 - tests/testdata/publish/invalid_path.out | 11 - tests/testdata/publish/invalid_path/deno.json | 7 - tests/testdata/publish/invalid_path/mod.ts | 3 - .../publish/invalid_path/path with spaces.txt | 0 tests/testdata/publish/javascript_decl_file.out | 5 - .../publish/javascript_decl_file/deno.json | 7 - .../testdata/publish/javascript_decl_file/mod.d.ts | 1 - tests/testdata/publish/javascript_decl_file/mod.js | 5 - .../publish/javascript_missing_decl_file.out | 20 -- .../publish/javascript_missing_decl_file/deno.json | 8 - .../publish/javascript_missing_decl_file/mod.js | 3 - .../publish/javascript_missing_decl_file/other.js | 3 - tests/testdata/publish/jsr_jsonc/jsr.jsonc | 11 - tests/testdata/publish/jsr_jsonc/mod.out | 6 - tests/testdata/publish/jsr_jsonc/mod.ts | 7 - tests/testdata/publish/jsr_jsonc/std_http.ts | 6 - tests/testdata/publish/missing_deno_json.out | 1 - tests/testdata/publish/missing_deno_json/main.ts | 3 - tests/testdata/publish/no_token.out | 1 - tests/testdata/publish/node_specifier.out | 8 - tests/testdata/publish/node_specifier/deno.json | 7 - tests/testdata/publish/node_specifier/mod.ts | 5 - tests/testdata/publish/package_json.out | 8 - tests/testdata/publish/package_json/deno.json | 8 - tests/testdata/publish/package_json/mod.ts | 9 - tests/testdata/publish/package_json/package.json | 7 - tests/testdata/publish/sloppy_imports.out | 10 - tests/testdata/publish/sloppy_imports/b/index.ts | 1 - tests/testdata/publish/sloppy_imports/deno.json | 7 - tests/testdata/publish/sloppy_imports/mod.ts | 1 - .../publish/sloppy_imports_no_warnings.out | 8 - .../publish/sloppy_imports_not_enabled.out | 2 - tests/testdata/publish/successful.out | 6 - tests/testdata/publish/successful_no_check.out | 4 - tests/testdata/publish/symlink.out | 15 -- tests/testdata/publish/symlink/deno.json | 7 - tests/testdata/publish/symlink/mod.ts | 3 - tests/testdata/publish/symlink/symlink | 1 - .../publish/unanalyzable_dynamic_import.out | 16 -- .../publish/unanalyzable_dynamic_import/deno.json | 7 - .../publish/unanalyzable_dynamic_import/mod.ts | 2 - tests/testdata/publish/unsupported_jsx_tsx/foo.jsx | 5 - tests/testdata/publish/unsupported_jsx_tsx/foo.tsx | 5 - .../testdata/publish/unsupported_jsx_tsx/jsr.jsonc | 11 - tests/testdata/publish/unsupported_jsx_tsx/mod.out | 17 -- tests/testdata/publish/unsupported_jsx_tsx/mod.ts | 7 - tests/testdata/publish/workspace.out | 12 - tests/testdata/publish/workspace/bar/deno.json | 7 - tests/testdata/publish/workspace/bar/mod.ts | 3 - tests/testdata/publish/workspace/deno.json | 6 - tests/testdata/publish/workspace/foo/deno.json | 10 - tests/testdata/publish/workspace/foo/mod.ts | 5 - tests/testdata/publish/workspace_individual.out | 6 - tests/testdata/run/fetch/other.ts | 1 - tests/testdata/run/fetch/test.ts | 1 - .../run/with_package_json/no_deno_json/main.out | 4 - .../run/with_package_json/no_deno_json/main.ts | 4 - .../no_deno_json/no_package_json_imports.out | 1 - .../no_deno_json/no_package_json_imports.ts | 1 - .../with_package_json/no_deno_json/noconfig.out | 4 - .../run/with_package_json/no_deno_json/noconfig.ts | 8 - .../with_package_json/no_deno_json/package.json | 9 - .../with_package_json/no_deno_json/sub_dir/main.js | 3 - .../no_deno_json/sub_dir/main.out | 7 - .../test/relative_pattern_dot_slash/deno.json | 7 - .../test/relative_pattern_dot_slash/output.out | 5 - .../test/relative_pattern_dot_slash/test/add.mjs | 3 - .../relative_pattern_dot_slash/test/add.test.mjs | 7 - 519 files changed, 2627 insertions(+), 2119 deletions(-) create mode 100644 tests/specs/bench/allow_all/__test__.jsonc create mode 100644 tests/specs/bench/allow_all/allow_all.out create mode 100644 tests/specs/bench/allow_all/allow_all.ts create mode 100644 tests/specs/bench/allow_none/__test__.jsonc create mode 100644 tests/specs/bench/allow_none/allow_none.out create mode 100644 tests/specs/bench/allow_none/allow_none.ts create mode 100644 tests/specs/bench/before_unload_prevent_default/__test__.jsonc create mode 100644 tests/specs/bench/before_unload_prevent_default/before_unload_prevent_default.out create mode 100644 tests/specs/bench/before_unload_prevent_default/before_unload_prevent_default.ts create mode 100644 tests/specs/bench/bench_explicit_start_end/__test__.jsonc create mode 100644 tests/specs/bench/bench_explicit_start_end/explicit_start_and_end.out create mode 100644 tests/specs/bench/bench_explicit_start_end/explicit_start_and_end.ts create mode 100644 tests/specs/bench/bench_formatting/__test__.jsonc create mode 100644 tests/specs/bench/bench_formatting/bench_formatting.out create mode 100644 tests/specs/bench/bench_formatting/bench_formatting.ts create mode 100644 tests/specs/bench/check_local_by_default/__test__.jsonc create mode 100644 tests/specs/bench/check_local_by_default/check_local_by_default.out create mode 100644 tests/specs/bench/check_local_by_default/check_local_by_default.ts create mode 100644 tests/specs/bench/check_local_by_default2/__test__.jsonc create mode 100644 tests/specs/bench/check_local_by_default2/check_local_by_default2.out create mode 100644 tests/specs/bench/check_local_by_default2/check_local_by_default2.ts create mode 100644 tests/specs/bench/clear_timeout/__test__.jsonc create mode 100644 tests/specs/bench/clear_timeout/clear_timeout.out create mode 100644 tests/specs/bench/clear_timeout/clear_timeout.ts create mode 100644 tests/specs/bench/collect/__test__.jsonc create mode 100644 tests/specs/bench/collect/collect.out create mode 100644 tests/specs/bench/collect/collect/bench.ts create mode 100644 tests/specs/bench/collect/collect/deno.jsonc create mode 100644 tests/specs/bench/collect/collect/deno.malformed.jsonc create mode 100644 tests/specs/bench/collect/collect/deno2.jsonc create mode 100644 tests/specs/bench/collect/collect/ignore/bench.ts create mode 100644 tests/specs/bench/collect/collect/include/2_bench.ts create mode 100644 tests/specs/bench/collect/collect/include/bench.ts create mode 100644 tests/specs/bench/collect/collect2.out create mode 100644 tests/specs/bench/collect/collect_with_malformed_config.out create mode 100644 tests/specs/bench/exit_sanitizer/__test__.jsonc create mode 100644 tests/specs/bench/exit_sanitizer/exit_sanitizer.out create mode 100644 tests/specs/bench/exit_sanitizer/exit_sanitizer.ts create mode 100644 tests/specs/bench/explicit_start_and_end_low_precision/__test__.jsonc create mode 100644 tests/specs/bench/explicit_start_and_end_low_precision/main.bench.out create mode 100644 tests/specs/bench/explicit_start_and_end_low_precision/main.bench.ts create mode 100644 tests/specs/bench/fail/__test__.jsonc create mode 100644 tests/specs/bench/fail/fail.out create mode 100644 tests/specs/bench/fail/fail.ts create mode 100644 tests/specs/bench/filter/__test__.jsonc create mode 100644 tests/specs/bench/filter/a_bench.ts create mode 100644 tests/specs/bench/filter/b_bench.ts create mode 100644 tests/specs/bench/filter/c_bench.ts create mode 100644 tests/specs/bench/filter/filter.out create mode 100644 tests/specs/bench/finally_timeout/__test__.jsonc create mode 100644 tests/specs/bench/finally_timeout/finally_timeout.out create mode 100644 tests/specs/bench/finally_timeout/finally_timeout.ts create mode 100644 tests/specs/bench/group_baseline/__test__.jsonc create mode 100644 tests/specs/bench/group_baseline/group_baseline.out create mode 100644 tests/specs/bench/group_baseline/group_baseline.ts create mode 100644 tests/specs/bench/ignore/__test__.jsonc create mode 100644 tests/specs/bench/ignore/ignore.out create mode 100644 tests/specs/bench/ignore/ignore.ts create mode 100644 tests/specs/bench/ignore_permissions/__test__.jsonc create mode 100644 tests/specs/bench/ignore_permissions/ignore_permissions.out create mode 100644 tests/specs/bench/ignore_permissions/ignore_permissions.ts create mode 100644 tests/specs/bench/interval/__test__.jsonc create mode 100644 tests/specs/bench/interval/interval.out create mode 100644 tests/specs/bench/interval/interval.ts create mode 100644 tests/specs/bench/json_output/__test__.jsonc create mode 100644 tests/specs/bench/json_output/pass.json.out create mode 100644 tests/specs/bench/json_output/pass.ts create mode 100644 tests/specs/bench/load_unload/__test__.jsonc create mode 100644 tests/specs/bench/load_unload/load_unload.out create mode 100644 tests/specs/bench/load_unload/load_unload.ts create mode 100644 tests/specs/bench/meta/__test__.jsonc create mode 100644 tests/specs/bench/meta/meta.out create mode 100644 tests/specs/bench/meta/meta.ts create mode 100644 tests/specs/bench/multifile_summary/__test__.jsonc create mode 100644 tests/specs/bench/multifile_summary/group_baseline.ts create mode 100644 tests/specs/bench/multifile_summary/multifile_summary.out create mode 100644 tests/specs/bench/multifile_summary/multiple_group.ts create mode 100644 tests/specs/bench/multifile_summary/pass.ts create mode 100644 tests/specs/bench/no_check/__test__.jsonc create mode 100644 tests/specs/bench/no_check/no_check.out create mode 100644 tests/specs/bench/no_check/no_check.ts create mode 100644 tests/specs/bench/no_prompt_by_default/__test__.jsonc create mode 100644 tests/specs/bench/no_prompt_by_default/no_prompt_by_default.out create mode 100644 tests/specs/bench/no_prompt_by_default/no_prompt_by_default.ts create mode 100644 tests/specs/bench/no_prompt_with_denied_perms/__test__.jsonc create mode 100644 tests/specs/bench/no_prompt_with_denied_perms/no_prompt_with_denied_perms.out create mode 100644 tests/specs/bench/no_prompt_with_denied_perms/no_prompt_with_denied_perms.ts create mode 100644 tests/specs/bench/no_run/__test__.jsonc create mode 100644 tests/specs/bench/no_run/no_run.out create mode 100644 tests/specs/bench/no_run/no_run.ts create mode 100644 tests/specs/bench/only/__test__.jsonc create mode 100644 tests/specs/bench/only/only.out create mode 100644 tests/specs/bench/only/only.ts create mode 100644 tests/specs/bench/overloads/__test__.jsonc create mode 100644 tests/specs/bench/overloads/overloads.out create mode 100644 tests/specs/bench/overloads/overloads.ts create mode 100644 tests/specs/bench/package_json/__test__.jsonc create mode 100644 tests/specs/bench/package_json/lib.bench.out create mode 100644 tests/specs/bench/package_json/lib.bench.ts create mode 100644 tests/specs/bench/package_json/lib.ts create mode 100644 tests/specs/bench/package_json/package.json create mode 100644 tests/specs/bench/pass/__test__.jsonc create mode 100644 tests/specs/bench/pass/pass.out create mode 100644 tests/specs/bench/pass/pass.ts create mode 100644 tests/specs/bench/quiet/__test__.jsonc create mode 100644 tests/specs/bench/quiet/quiet.out create mode 100644 tests/specs/bench/quiet/quiet.ts create mode 100644 tests/specs/bench/unhandled_rejection/__test__.jsonc create mode 100644 tests/specs/bench/unhandled_rejection/unhandled_rejection.out create mode 100644 tests/specs/bench/unhandled_rejection/unhandled_rejection.ts create mode 100644 tests/specs/bench/unresolved_promise/__test__.jsonc create mode 100644 tests/specs/bench/unresolved_promise/unresolved_promise.out create mode 100644 tests/specs/bench/unresolved_promise/unresolved_promise.ts create mode 100644 tests/specs/cache/check_local_by_default/__test__.jsonc create mode 100644 tests/specs/cache/check_local_by_default/check_local_by_default.out create mode 100644 tests/specs/cache/check_local_by_default/check_local_by_default.ts create mode 100644 tests/specs/cache/check_local_by_default2/__test__.jsonc create mode 100644 tests/specs/cache/check_local_by_default2/check_local_by_default2.out create mode 100644 tests/specs/cache/check_local_by_default2/check_local_by_default2.ts create mode 100644 tests/specs/cache/extensionless/__test__.jsonc create mode 100644 tests/specs/cache/extensionless/cache_extensionless.out create mode 100644 tests/specs/cache/fetch_multiple/__test__.jsonc create mode 100644 tests/specs/cache/fetch_multiple/fetch_multiple.out create mode 100644 tests/specs/cache/fetch_multiple/other.ts create mode 100644 tests/specs/cache/fetch_multiple/test.ts create mode 100644 tests/specs/cache/ignore_require/__test__.jsonc create mode 100644 tests/specs/cache/ignore_require/ignore_require.js create mode 100644 tests/specs/cache/json_import/__test__.jsonc create mode 100644 tests/specs/cache/json_import/main.ts create mode 100644 tests/specs/cache/json_import/test.json create mode 100644 tests/specs/cache/package_json/__test__.jsonc create mode 100644 tests/specs/cache/package_json/lib.ts create mode 100644 tests/specs/cache/package_json/main.cache.out create mode 100644 tests/specs/cache/package_json/main.ts create mode 100644 tests/specs/cache/package_json/package.json create mode 100644 tests/specs/cache/performance_stats/__test__.jsonc create mode 100644 tests/specs/cache/performance_stats/hello.ts create mode 100644 tests/specs/cache/performance_stats/performance_stats.out create mode 100644 tests/specs/cache/random_extension/__test__.jsonc create mode 100644 tests/specs/cache/random_extension/cache_random_extension.out create mode 100644 tests/specs/cache/redirect/__test__.jsonc create mode 100644 tests/specs/cache/redirect/redirect_cache.out create mode 100644 tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts create mode 100644 tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out create mode 100644 tests/specs/cache/with_bare_import/__test__.jsonc create mode 100644 tests/specs/check/check_types_dts/__test__.jsonc create mode 100644 tests/specs/check/check_types_dts/deno.json create mode 100644 tests/specs/check/check_types_dts/main.out create mode 100644 tests/specs/check/check_types_dts/main.ts create mode 100644 tests/specs/check/check_types_dts/types.d.ts create mode 100644 tests/specs/check/check_with_excluded_file_specified/__test__.jsonc create mode 100644 tests/specs/check/check_with_excluded_file_specified/check.out create mode 100644 tests/specs/check/check_with_excluded_file_specified/deno.json create mode 100644 tests/specs/check/check_with_excluded_file_specified/lib/types.d.ts create mode 100644 tests/specs/check/extensionless/__test__.jsonc create mode 100644 tests/specs/check/extensionless/check.out create mode 100644 tests/specs/check/random_extension/__test__.jsonc create mode 100644 tests/specs/check/random_extension/output.out create mode 100644 tests/specs/check/with_bare_import/095_cache_with_bare_import.ts create mode 100644 tests/specs/check/with_bare_import/095_cache_with_bare_import.ts.out create mode 100644 tests/specs/check/with_bare_import/__test__.jsonc create mode 100644 tests/specs/lint/no_slow_types/__test__.jsonc create mode 100644 tests/specs/lint/no_slow_types/a.ts create mode 100644 tests/specs/lint/no_slow_types/b.ts create mode 100644 tests/specs/lint/no_slow_types/c.ts create mode 100644 tests/specs/lint/no_slow_types/d.ts create mode 100644 tests/specs/lint/no_slow_types/deno.json create mode 100644 tests/specs/lint/no_slow_types/deno.non-package.json create mode 100644 tests/specs/lint/no_slow_types/no_slow_types.out create mode 100644 tests/specs/lint/no_slow_types/no_slow_types_entrypoint.out create mode 100644 tests/specs/lint/no_slow_types_entrypoint/__test__.jsonc create mode 100644 tests/specs/lint/no_slow_types_entrypoint/a.ts create mode 100644 tests/specs/lint/no_slow_types_entrypoint/b.ts create mode 100644 tests/specs/lint/no_slow_types_entrypoint/c.ts create mode 100644 tests/specs/lint/no_slow_types_entrypoint/d.ts create mode 100644 tests/specs/lint/no_slow_types_entrypoint/deno.json create mode 100644 tests/specs/lint/no_slow_types_entrypoint/deno.non-package.json create mode 100644 tests/specs/lint/no_slow_types_entrypoint/no_slow_types.out create mode 100644 tests/specs/lint/no_slow_types_entrypoint/no_slow_types_entrypoint.out create mode 100644 tests/specs/lint/no_slow_types_workspace/__test__.jsonc create mode 100644 tests/specs/lint/no_slow_types_workspace/a/b.ts create mode 100644 tests/specs/lint/no_slow_types_workspace/a/d.ts create mode 100644 tests/specs/lint/no_slow_types_workspace/a/deno.json create mode 100644 tests/specs/lint/no_slow_types_workspace/a/mod.ts create mode 100644 tests/specs/lint/no_slow_types_workspace/b/deno.json create mode 100644 tests/specs/lint/no_slow_types_workspace/b/mod.ts create mode 100644 tests/specs/lint/no_slow_types_workspace/c/deno.json create mode 100644 tests/specs/lint/no_slow_types_workspace/c/mod_c.ts create mode 100644 tests/specs/lint/no_slow_types_workspace/deno.json create mode 100644 tests/specs/lint/no_slow_types_workspace/output.out create mode 100644 tests/specs/lockfile/no_lock/__test__.jsonc create mode 100644 tests/specs/lockfile/no_lock/bench.nolock.out create mode 100644 tests/specs/lockfile/no_lock/deno.json create mode 100644 tests/specs/lockfile/no_lock/deno.lock create mode 100644 tests/specs/lockfile/no_lock/doc.nolock.out create mode 100644 tests/specs/lockfile/no_lock/fail.out create mode 100644 tests/specs/lockfile/no_lock/fail_initial.out create mode 100644 tests/specs/lockfile/no_lock/info.nolock.out create mode 100644 tests/specs/lockfile/no_lock/main.bench.ts create mode 100644 tests/specs/lockfile/no_lock/main.test.ts create mode 100644 tests/specs/lockfile/no_lock/main.ts create mode 100644 tests/specs/lockfile/no_lock/test.nolock.out create mode 100644 tests/specs/publish/allow_slow_types/__test__.jsonc create mode 100644 tests/specs/publish/allow_slow_types/allow_slow_types.out create mode 100644 tests/specs/publish/allow_slow_types/deno.json create mode 100644 tests/specs/publish/allow_slow_types/mod.ts create mode 100644 tests/specs/publish/bare_node_builtins/__test__.jsonc create mode 100644 tests/specs/publish/bare_node_builtins/bare_node_builtins.out create mode 100644 tests/specs/publish/bare_node_builtins/deno.json create mode 100644 tests/specs/publish/bare_node_builtins/mod.ts create mode 100644 tests/specs/publish/bare_node_builtins/no_warnings.out create mode 100644 tests/specs/publish/config_file_jsonc/__test__.jsonc create mode 100644 tests/specs/publish/config_file_jsonc/deno.jsonc create mode 100644 tests/specs/publish/config_file_jsonc/deno_jsonc.out create mode 100644 tests/specs/publish/config_file_jsonc/mod.ts create mode 100644 tests/specs/publish/config_file_jsonc/std_http.ts create mode 100644 tests/specs/publish/config_flag/__test__.jsonc create mode 100644 tests/specs/publish/config_flag/successful.out create mode 100644 tests/specs/publish/config_flag/successful/deno.json create mode 100644 tests/specs/publish/config_flag/successful/mod.ts create mode 100644 tests/specs/publish/config_flag/successful/std_http.ts create mode 100644 tests/specs/publish/dry_run/__test__.jsonc create mode 100644 tests/specs/publish/dry_run/deno.json create mode 100644 tests/specs/publish/dry_run/dry_run.out create mode 100644 tests/specs/publish/dry_run/mod.ts create mode 100644 tests/specs/publish/dry_run/std_http.ts create mode 100644 tests/specs/publish/has_slow_types/__test__.jsonc create mode 100644 tests/specs/publish/has_slow_types/deno.json create mode 100644 tests/specs/publish/has_slow_types/has_slow_types.out create mode 100644 tests/specs/publish/has_slow_types/mod.ts create mode 100644 tests/specs/publish/invalid_import/__test__.jsonc create mode 100644 tests/specs/publish/invalid_import/deno.json create mode 100644 tests/specs/publish/invalid_import/invalid_import.out create mode 100644 tests/specs/publish/invalid_import/mod.ts create mode 100644 tests/specs/publish/invalid_import_esm_sh_suggestion/__test__.jsonc create mode 100644 tests/specs/publish/invalid_import_esm_sh_suggestion/deno.json create mode 100644 tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out create mode 100644 tests/specs/publish/invalid_import_esm_sh_suggestion/mod.ts create mode 100644 tests/specs/publish/invalid_path/__test__.jsonc create mode 100644 tests/specs/publish/invalid_path/deno.json create mode 100644 tests/specs/publish/invalid_path/invalid_path.out create mode 100644 tests/specs/publish/invalid_path/mod.ts create mode 100644 tests/specs/publish/invalid_path/path with spaces.txt create mode 100644 tests/specs/publish/javascript_decl_file/__test__.jsonc create mode 100644 tests/specs/publish/javascript_decl_file/deno.json create mode 100644 tests/specs/publish/javascript_decl_file/javascript_decl_file.out create mode 100644 tests/specs/publish/javascript_decl_file/mod.d.ts create mode 100644 tests/specs/publish/javascript_decl_file/mod.js create mode 100644 tests/specs/publish/javascript_missing_decl_file/__test__.jsonc create mode 100644 tests/specs/publish/javascript_missing_decl_file/deno.json create mode 100644 tests/specs/publish/javascript_missing_decl_file/javascript_missing_decl_file.out create mode 100644 tests/specs/publish/javascript_missing_decl_file/mod.js create mode 100644 tests/specs/publish/javascript_missing_decl_file/other.js create mode 100644 tests/specs/publish/jsr_jsonc/__test__.jsonc create mode 100644 tests/specs/publish/jsr_jsonc/jsr.jsonc create mode 100644 tests/specs/publish/jsr_jsonc/mod.out create mode 100644 tests/specs/publish/jsr_jsonc/mod.ts create mode 100644 tests/specs/publish/jsr_jsonc/std_http.ts create mode 100644 tests/specs/publish/missing_deno_json/__test__.jsonc create mode 100644 tests/specs/publish/missing_deno_json/main.ts create mode 100644 tests/specs/publish/missing_deno_json/missing_deno_json.out create mode 100644 tests/specs/publish/no_check/__test__.jsonc create mode 100644 tests/specs/publish/no_check/deno.json create mode 100644 tests/specs/publish/no_check/mod.ts create mode 100644 tests/specs/publish/no_check/std_http.ts create mode 100644 tests/specs/publish/no_check/successful_no_check.out create mode 100644 tests/specs/publish/no_token/__test__.jsonc create mode 100644 tests/specs/publish/no_token/main.ts create mode 100644 tests/specs/publish/no_token/no_token.out create mode 100644 tests/specs/publish/node_specifier/__test__.jsonc create mode 100644 tests/specs/publish/node_specifier/deno.json create mode 100644 tests/specs/publish/node_specifier/mod.ts create mode 100644 tests/specs/publish/node_specifier/node_specifier.out create mode 100644 tests/specs/publish/package_json/__test__.jsonc create mode 100644 tests/specs/publish/package_json/deno.json create mode 100644 tests/specs/publish/package_json/mod.ts create mode 100644 tests/specs/publish/package_json/package.json create mode 100644 tests/specs/publish/package_json/package_json.out create mode 100644 tests/specs/publish/sloppy_imports/__test__.jsonc create mode 100644 tests/specs/publish/sloppy_imports/b/index.ts create mode 100644 tests/specs/publish/sloppy_imports/deno.json create mode 100644 tests/specs/publish/sloppy_imports/mod.ts create mode 100644 tests/specs/publish/sloppy_imports/sloppy_imports.out create mode 100644 tests/specs/publish/sloppy_imports/sloppy_imports_no_warnings.out create mode 100644 tests/specs/publish/sloppy_imports/sloppy_imports_not_enabled.out create mode 100644 tests/specs/publish/successful/__test__.jsonc create mode 100644 tests/specs/publish/successful/deno.json create mode 100644 tests/specs/publish/successful/mod.ts create mode 100644 tests/specs/publish/successful/std_http.ts create mode 100644 tests/specs/publish/successful/successful.out create mode 100644 tests/specs/publish/symlink/__test__.jsonc create mode 100644 tests/specs/publish/symlink/deno.json create mode 100644 tests/specs/publish/symlink/mod.ts create mode 100644 tests/specs/publish/symlink/symlink.out create mode 100644 tests/specs/publish/unanalyzable_dynamic_import/__test__.jsonc create mode 100644 tests/specs/publish/unanalyzable_dynamic_import/deno.json create mode 100644 tests/specs/publish/unanalyzable_dynamic_import/mod.ts create mode 100644 tests/specs/publish/unanalyzable_dynamic_import/unanalyzable_dynamic_import.out create mode 100644 tests/specs/publish/unsupported_jsx_tsx/__test__.jsonc create mode 100644 tests/specs/publish/unsupported_jsx_tsx/foo.jsx create mode 100644 tests/specs/publish/unsupported_jsx_tsx/foo.tsx create mode 100644 tests/specs/publish/unsupported_jsx_tsx/jsr.jsonc create mode 100644 tests/specs/publish/unsupported_jsx_tsx/mod.out create mode 100644 tests/specs/publish/unsupported_jsx_tsx/mod.ts create mode 100644 tests/specs/publish/workspace/__test__.jsonc create mode 100644 tests/specs/publish/workspace/bar/deno.json create mode 100644 tests/specs/publish/workspace/bar/mod.ts create mode 100644 tests/specs/publish/workspace/deno.json create mode 100644 tests/specs/publish/workspace/foo/deno.json create mode 100644 tests/specs/publish/workspace/foo/mod.ts create mode 100644 tests/specs/publish/workspace/workspace.out create mode 100644 tests/specs/publish/workspace/workspace_individual.out create mode 100644 tests/specs/run/no_deno_json/__test__.jsonc create mode 100644 tests/specs/run/no_deno_json/code/main.ts create mode 100644 tests/specs/run/no_deno_json/code/no_package_json_imports.ts create mode 100644 tests/specs/run/no_deno_json/code/noconfig.ts create mode 100644 tests/specs/run/no_deno_json/code/package.json create mode 100644 tests/specs/run/no_deno_json/code/sub_dir/main.js create mode 100644 tests/specs/run/no_deno_json/code/sub_dir/main.out create mode 100644 tests/specs/run/no_deno_json/main.out create mode 100644 tests/specs/run/no_deno_json/no_package_json_imports.out create mode 100644 tests/specs/run/no_deno_json/noconfig.out create mode 100644 tests/specs/test/include_relative_pattern_dot_slash/__test__.jsonc create mode 100644 tests/specs/test/include_relative_pattern_dot_slash/deno.json create mode 100644 tests/specs/test/include_relative_pattern_dot_slash/output.out create mode 100644 tests/specs/test/include_relative_pattern_dot_slash/test/add.mjs create mode 100644 tests/specs/test/include_relative_pattern_dot_slash/test/add.test.mjs delete mode 100644 tests/testdata/bench/allow_all.ts delete mode 100644 tests/testdata/bench/allow_none.ts delete mode 100644 tests/testdata/bench/before_unload_prevent_default.ts delete mode 100644 tests/testdata/bench/bench_formatting.ts delete mode 100644 tests/testdata/bench/check_local_by_default.ts delete mode 100644 tests/testdata/bench/check_local_by_default2.ts delete mode 100644 tests/testdata/bench/clear_timeout.ts delete mode 100644 tests/testdata/bench/collect.out delete mode 100644 tests/testdata/bench/collect/bench.ts delete mode 100644 tests/testdata/bench/collect/deno.jsonc delete mode 100644 tests/testdata/bench/collect/deno.malformed.jsonc delete mode 100644 tests/testdata/bench/collect/deno2.jsonc delete mode 100644 tests/testdata/bench/collect/ignore/bench.ts delete mode 100644 tests/testdata/bench/collect/include/2_bench.ts delete mode 100644 tests/testdata/bench/collect/include/bench.ts delete mode 100644 tests/testdata/bench/collect2.out delete mode 100644 tests/testdata/bench/collect_with_malformed_config.out delete mode 100644 tests/testdata/bench/exit_sanitizer.ts delete mode 100644 tests/testdata/bench/explicit_start_and_end.ts delete mode 100644 tests/testdata/bench/explicit_start_and_end_low_precision.out delete mode 100644 tests/testdata/bench/explicit_start_and_end_low_precision.ts delete mode 100644 tests/testdata/bench/fail.ts delete mode 100644 tests/testdata/bench/filter.out delete mode 100644 tests/testdata/bench/filter/a_bench.ts delete mode 100644 tests/testdata/bench/filter/b_bench.ts delete mode 100644 tests/testdata/bench/filter/c_bench.ts delete mode 100644 tests/testdata/bench/finally_timeout.ts delete mode 100644 tests/testdata/bench/group_baseline.ts delete mode 100644 tests/testdata/bench/ignore.ts delete mode 100644 tests/testdata/bench/ignore_permissions.ts delete mode 100644 tests/testdata/bench/interval.ts delete mode 100644 tests/testdata/bench/load_unload.ts delete mode 100644 tests/testdata/bench/meta.ts delete mode 100644 tests/testdata/bench/multiple_group.ts delete mode 100644 tests/testdata/bench/no_check.ts delete mode 100644 tests/testdata/bench/no_prompt_by_default.ts delete mode 100644 tests/testdata/bench/no_prompt_with_denied_perms.ts delete mode 100644 tests/testdata/bench/no_run.ts delete mode 100644 tests/testdata/bench/only.ts delete mode 100644 tests/testdata/bench/overloads.ts delete mode 100644 tests/testdata/bench/pass.ts delete mode 100644 tests/testdata/bench/quiet.ts delete mode 100644 tests/testdata/bench/unhandled_rejection.ts delete mode 100644 tests/testdata/bench/unresolved_promise.ts delete mode 100644 tests/testdata/cache/095_cache_with_bare_import.ts delete mode 100644 tests/testdata/cache/cache_extensionless.out delete mode 100644 tests/testdata/cache/cache_random_extension.out delete mode 100644 tests/testdata/cache/check_local_by_default.ts delete mode 100644 tests/testdata/cache/check_local_by_default2.ts delete mode 100644 tests/testdata/cache/ignore_require.js delete mode 100644 tests/testdata/cache/json_import/main.ts delete mode 100644 tests/testdata/cache/json_import/test.json delete mode 100644 tests/testdata/cache/redirect_cache.out delete mode 100644 tests/testdata/check/excluded_file_specified/check.out delete mode 100644 tests/testdata/check/excluded_file_specified/deno.json delete mode 100644 tests/testdata/check/excluded_file_specified/lib/types.d.ts delete mode 100644 tests/testdata/check/types_dts/deno.json delete mode 100644 tests/testdata/check/types_dts/main.out delete mode 100644 tests/testdata/check/types_dts/main.ts delete mode 100644 tests/testdata/check/types_dts/types.d.ts delete mode 100644 tests/testdata/lint/no_slow_types/a.ts delete mode 100644 tests/testdata/lint/no_slow_types/b.ts delete mode 100644 tests/testdata/lint/no_slow_types/c.ts delete mode 100644 tests/testdata/lint/no_slow_types/d.ts delete mode 100644 tests/testdata/lint/no_slow_types/deno.json delete mode 100644 tests/testdata/lint/no_slow_types/deno.non-package.json delete mode 100644 tests/testdata/lint/no_slow_types/no_slow_types.out delete mode 100644 tests/testdata/lint/no_slow_types/no_slow_types_entrypoint.out delete mode 100644 tests/testdata/lint/no_slow_types_workspace/a/b.ts delete mode 100644 tests/testdata/lint/no_slow_types_workspace/a/d.ts delete mode 100644 tests/testdata/lint/no_slow_types_workspace/a/deno.json delete mode 100644 tests/testdata/lint/no_slow_types_workspace/a/mod.ts delete mode 100644 tests/testdata/lint/no_slow_types_workspace/b/deno.json delete mode 100644 tests/testdata/lint/no_slow_types_workspace/b/mod.ts delete mode 100644 tests/testdata/lint/no_slow_types_workspace/c/deno.json delete mode 100644 tests/testdata/lint/no_slow_types_workspace/c/mod_c.ts delete mode 100644 tests/testdata/lint/no_slow_types_workspace/deno.json delete mode 100644 tests/testdata/lint/no_slow_types_workspace/output.out delete mode 100644 tests/testdata/lockfile/basic/bench.nolock.out delete mode 100644 tests/testdata/lockfile/basic/deno.json delete mode 100644 tests/testdata/lockfile/basic/deno.lock delete mode 100644 tests/testdata/lockfile/basic/doc.nolock.out delete mode 100644 tests/testdata/lockfile/basic/fail.out delete mode 100644 tests/testdata/lockfile/basic/info.nolock.out delete mode 100644 tests/testdata/lockfile/basic/main.bench.ts delete mode 100644 tests/testdata/lockfile/basic/main.test.ts delete mode 100644 tests/testdata/lockfile/basic/main.ts delete mode 100644 tests/testdata/lockfile/basic/test.nolock.out delete mode 100644 tests/testdata/package_json/basic/lib.bench.out delete mode 100644 tests/testdata/package_json/basic/lib.bench.ts delete mode 100644 tests/testdata/package_json/basic/main.cache.out delete mode 100644 tests/testdata/publish/allow_slow_types.out delete mode 100644 tests/testdata/publish/bare_node_builtins.out delete mode 100644 tests/testdata/publish/bare_node_builtins/deno.json delete mode 100644 tests/testdata/publish/bare_node_builtins/mod.ts delete mode 100644 tests/testdata/publish/bare_node_builtins_no_warnings.out delete mode 100644 tests/testdata/publish/deno_jsonc.out delete mode 100644 tests/testdata/publish/deno_jsonc/deno.jsonc delete mode 100644 tests/testdata/publish/deno_jsonc/mod.ts delete mode 100644 tests/testdata/publish/deno_jsonc/std_http.ts delete mode 100644 tests/testdata/publish/dry_run.out delete mode 100644 tests/testdata/publish/has_slow_types.out delete mode 100644 tests/testdata/publish/has_slow_types/deno.json delete mode 100644 tests/testdata/publish/has_slow_types/mod.ts delete mode 100644 tests/testdata/publish/invalid_import.out delete mode 100644 tests/testdata/publish/invalid_import/deno.json delete mode 100644 tests/testdata/publish/invalid_import/mod.ts delete mode 100644 tests/testdata/publish/invalid_import_esm_sh_suggestion.out delete mode 100644 tests/testdata/publish/invalid_import_esm_sh_suggestion/deno.json delete mode 100644 tests/testdata/publish/invalid_import_esm_sh_suggestion/mod.ts delete mode 100644 tests/testdata/publish/invalid_path.out delete mode 100644 tests/testdata/publish/invalid_path/deno.json delete mode 100644 tests/testdata/publish/invalid_path/mod.ts delete mode 100644 tests/testdata/publish/invalid_path/path with spaces.txt delete mode 100644 tests/testdata/publish/javascript_decl_file.out delete mode 100644 tests/testdata/publish/javascript_decl_file/deno.json delete mode 100644 tests/testdata/publish/javascript_decl_file/mod.d.ts delete mode 100644 tests/testdata/publish/javascript_decl_file/mod.js delete mode 100644 tests/testdata/publish/javascript_missing_decl_file.out delete mode 100644 tests/testdata/publish/javascript_missing_decl_file/deno.json delete mode 100644 tests/testdata/publish/javascript_missing_decl_file/mod.js delete mode 100644 tests/testdata/publish/javascript_missing_decl_file/other.js delete mode 100644 tests/testdata/publish/jsr_jsonc/jsr.jsonc delete mode 100644 tests/testdata/publish/jsr_jsonc/mod.out delete mode 100644 tests/testdata/publish/jsr_jsonc/mod.ts delete mode 100644 tests/testdata/publish/jsr_jsonc/std_http.ts delete mode 100644 tests/testdata/publish/missing_deno_json.out delete mode 100644 tests/testdata/publish/missing_deno_json/main.ts delete mode 100644 tests/testdata/publish/no_token.out delete mode 100644 tests/testdata/publish/node_specifier.out delete mode 100644 tests/testdata/publish/node_specifier/deno.json delete mode 100644 tests/testdata/publish/node_specifier/mod.ts delete mode 100644 tests/testdata/publish/package_json.out delete mode 100644 tests/testdata/publish/package_json/deno.json delete mode 100644 tests/testdata/publish/package_json/mod.ts delete mode 100644 tests/testdata/publish/package_json/package.json delete mode 100644 tests/testdata/publish/sloppy_imports.out delete mode 100644 tests/testdata/publish/sloppy_imports/b/index.ts delete mode 100644 tests/testdata/publish/sloppy_imports/deno.json delete mode 100644 tests/testdata/publish/sloppy_imports/mod.ts delete mode 100644 tests/testdata/publish/sloppy_imports_no_warnings.out delete mode 100644 tests/testdata/publish/sloppy_imports_not_enabled.out delete mode 100644 tests/testdata/publish/successful.out delete mode 100644 tests/testdata/publish/successful_no_check.out delete mode 100644 tests/testdata/publish/symlink.out delete mode 100644 tests/testdata/publish/symlink/deno.json delete mode 100644 tests/testdata/publish/symlink/mod.ts delete mode 120000 tests/testdata/publish/symlink/symlink delete mode 100644 tests/testdata/publish/unanalyzable_dynamic_import.out delete mode 100644 tests/testdata/publish/unanalyzable_dynamic_import/deno.json delete mode 100644 tests/testdata/publish/unanalyzable_dynamic_import/mod.ts delete mode 100644 tests/testdata/publish/unsupported_jsx_tsx/foo.jsx delete mode 100644 tests/testdata/publish/unsupported_jsx_tsx/foo.tsx delete mode 100644 tests/testdata/publish/unsupported_jsx_tsx/jsr.jsonc delete mode 100644 tests/testdata/publish/unsupported_jsx_tsx/mod.out delete mode 100644 tests/testdata/publish/unsupported_jsx_tsx/mod.ts delete mode 100644 tests/testdata/publish/workspace.out delete mode 100644 tests/testdata/publish/workspace/bar/deno.json delete mode 100644 tests/testdata/publish/workspace/bar/mod.ts delete mode 100644 tests/testdata/publish/workspace/deno.json delete mode 100644 tests/testdata/publish/workspace/foo/deno.json delete mode 100644 tests/testdata/publish/workspace/foo/mod.ts delete mode 100644 tests/testdata/publish/workspace_individual.out delete mode 100644 tests/testdata/run/fetch/other.ts delete mode 100644 tests/testdata/run/fetch/test.ts delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/main.out delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/main.ts delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/no_package_json_imports.out delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/no_package_json_imports.ts delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/noconfig.out delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/noconfig.ts delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/package.json delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.js delete mode 100644 tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.out delete mode 100644 tests/testdata/test/relative_pattern_dot_slash/deno.json delete mode 100644 tests/testdata/test/relative_pattern_dot_slash/output.out delete mode 100644 tests/testdata/test/relative_pattern_dot_slash/test/add.mjs delete mode 100644 tests/testdata/test/relative_pattern_dot_slash/test/add.test.mjs (limited to 'tests') diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 5552f6f31..5393d1589 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -43,7 +43,7 @@ deno_lockfile.workspace = true deno_terminal.workspace = true deno_tls.workspace = true fastwebsockets = { workspace = true, features = ["upgrade", "unstable-split"] } -file_test_runner = "0.4.0" +file_test_runner = "0.4.1" flaky_test = "=0.1.0" http.workspace = true http-body-util.workspace = true diff --git a/tests/integration/bench_tests.rs b/tests/integration/bench_tests.rs index 3306a0f96..d588f5b43 100644 --- a/tests/integration/bench_tests.rs +++ b/tests/integration/bench_tests.rs @@ -3,223 +3,11 @@ use deno_core::serde_json::json; use deno_core::url::Url; use test_util as util; -use test_util::itest; -use test_util::itest_flaky; use util::assert_contains; use util::assert_not_contains; -use util::env_vars_for_npm_tests; use util::TestContext; use util::TestContextBuilder; -itest!(overloads { - args: "bench bench/overloads.ts", - exit_code: 0, - output: "bench/overloads.out", -}); - -itest!(meta { - args: "bench bench/meta.ts", - exit_code: 0, - output: "bench/meta.out", -}); - -itest!(pass { - args: "bench bench/pass.ts", - exit_code: 0, - output: "bench/pass.out", -}); - -itest!(ignore { - args: "bench bench/ignore.ts", - exit_code: 0, - output: "bench/ignore.out", -}); - -itest!(ignore_permissions { - args: "bench bench/ignore_permissions.ts", - exit_code: 0, - output: "bench/ignore_permissions.out", -}); - -itest!(fail { - args: "bench bench/fail.ts", - exit_code: 1, - output: "bench/fail.out", -}); - -itest!(bench_formatting { - args: "bench bench/bench_formatting.ts", - exit_code: 0, - output: "bench/bench_formatting.out", -}); - -itest!(collect { - args: "bench --ignore=bench/collect/ignore bench/collect", - exit_code: 0, - output: "bench/collect.out", -}); - -itest!(load_unload { - args: "bench bench/load_unload.ts", - exit_code: 0, - output: "bench/load_unload.out", -}); - -itest!(interval { - args: "bench bench/interval.ts", - exit_code: 0, - output: "bench/interval.out", -}); - -itest!(quiet { - args: "bench --quiet bench/quiet.ts", - exit_code: 0, - output: "bench/quiet.out", -}); - -itest!(only { - args: "bench bench/only.ts", - exit_code: 1, - output: "bench/only.out", -}); - -itest!(multifile_summary { - args: "bench bench/group_baseline.ts bench/pass.ts bench/multiple_group.ts", - exit_code: 0, - output: "bench/multifile_summary.out", -}); - -itest!(no_check { - args: "bench --no-check bench/no_check.ts", - exit_code: 1, - output: "bench/no_check.out", -}); - -itest!(allow_all { - args: "bench --allow-all bench/allow_all.ts", - exit_code: 0, - output: "bench/allow_all.out", -}); - -itest!(allow_none { - args: "bench bench/allow_none.ts", - exit_code: 1, - output: "bench/allow_none.out", -}); - -itest!(exit_sanitizer { - args: "bench bench/exit_sanitizer.ts", - output: "bench/exit_sanitizer.out", - exit_code: 1, -}); - -itest!(clear_timeout { - args: "bench bench/clear_timeout.ts", - exit_code: 0, - output: "bench/clear_timeout.out", -}); - -itest!(finally_timeout { - args: "bench bench/finally_timeout.ts", - exit_code: 1, - output: "bench/finally_timeout.out", -}); - -itest!(before_unload_prevent_default { - args: "bench --quiet bench/before_unload_prevent_default.ts", - output: "bench/before_unload_prevent_default.out", -}); - -itest!(group_baseline { - args: "bench bench/group_baseline.ts", - exit_code: 0, - output: "bench/group_baseline.out", -}); - -itest!(unresolved_promise { - args: "bench bench/unresolved_promise.ts", - exit_code: 1, - output: "bench/unresolved_promise.out", -}); - -itest!(unhandled_rejection { - args: "bench bench/unhandled_rejection.ts", - exit_code: 1, - output: "bench/unhandled_rejection.out", -}); - -itest!(filter { - args: "bench --filter=foo bench/filter", - exit_code: 0, - output: "bench/filter.out", -}); - -itest!(no_run { - args: "bench --no-run bench/no_run.ts", - output: "bench/no_run.out", - exit_code: 1, -}); - -itest!(no_prompt_by_default { - args: "bench --quiet bench/no_prompt_by_default.ts", - exit_code: 1, - output: "bench/no_prompt_by_default.out", -}); - -itest!(no_prompt_with_denied_perms { - args: "bench --quiet --allow-read bench/no_prompt_with_denied_perms.ts", - exit_code: 1, - output: "bench/no_prompt_with_denied_perms.out", -}); - -itest!(check_local_by_default { - args: "bench --quiet bench/check_local_by_default.ts", - output: "bench/check_local_by_default.out", - http_server: true, -}); - -itest!(check_local_by_default2 { - args: "bench --quiet bench/check_local_by_default2.ts", - output: "bench/check_local_by_default2.out", - http_server: true, - exit_code: 1, -}); - -itest!(bench_explicit_start_end { - args: "bench --quiet -A bench/explicit_start_and_end.ts", - output: "bench/explicit_start_and_end.out", - exit_code: 1, -}); - -itest_flaky!(bench_explicit_start_end_low_precision { - args: "bench --quiet -A bench/explicit_start_and_end_low_precision.ts", - output: "bench/explicit_start_and_end_low_precision.out", -}); - -itest!(bench_with_config { - args: "bench --config bench/collect/deno.jsonc bench/collect", - exit_code: 0, - output: "bench/collect.out", -}); - -itest!(bench_with_config2 { - args: "bench --config bench/collect/deno2.jsonc bench/collect", - exit_code: 0, - output: "bench/collect2.out", -}); - -itest!(bench_with_malformed_config { - args: "bench --config bench/collect/deno.malformed.jsonc", - exit_code: 1, - output: "bench/collect_with_malformed_config.out", -}); - -itest!(json_output { - args: "bench --json bench/pass.ts", - exit_code: 0, - output: "bench/pass.json.out", -}); - #[test] fn recursive_permissions_pledge() { let context = TestContext::default(); @@ -248,31 +36,6 @@ fn file_protocol() { .assert_matches_file("bench/file_protocol.out"); } -itest!(package_json_basic { - args: "bench", - output: "package_json/basic/lib.bench.out", - envs: env_vars_for_npm_tests(), - http_server: true, - cwd: Some("package_json/basic"), - copy_temp_dir: Some("package_json/basic"), - exit_code: 0, -}); - -itest!(bench_lock { - args: "bench", - http_server: true, - cwd: Some("lockfile/basic"), - exit_code: 10, - output: "lockfile/basic/fail.out", -}); - -itest!(bench_no_lock { - args: "bench --no-lock", - http_server: true, - cwd: Some("lockfile/basic"), - output: "lockfile/basic/bench.nolock.out", -}); - #[test] fn conditionally_loads_type_graph() { let context = TestContext::default(); diff --git a/tests/integration/cache_tests.rs b/tests/integration/cache_tests.rs index ff206c654..5711b0f2e 100644 --- a/tests/integration/cache_tests.rs +++ b/tests/integration/cache_tests.rs @@ -1,53 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use test_util::env_vars_for_npm_tests; -use test_util::itest; use test_util::TestContext; use test_util::TestContextBuilder; -itest!(_037_fetch_multiple { - args: "cache --reload --check=all run/fetch/test.ts run/fetch/other.ts", - http_server: true, - output: "cache/037_fetch_multiple.out", -}); - -itest!(_095_cache_with_bare_import { - args: "cache cache/095_cache_with_bare_import.ts", - output: "cache/095_cache_with_bare_import.ts.out", - exit_code: 1, -}); - -itest!(cache_extensionless { - args: "cache --reload --check=all http://localhost:4545/subdir/no_js_ext", - output: "cache/cache_extensionless.out", - http_server: true, -}); - -itest!(cache_random_extension { - args: - "cache --reload --check=all http://localhost:4545/subdir/no_js_ext@1.0.0", - output: "cache/cache_random_extension.out", - http_server: true, -}); - -itest!(performance_stats { - args: "cache --reload --check=all --log-level debug run/002_hello.ts", - output: "cache/performance_stats.out", -}); - -itest!(redirect_cache { - http_server: true, - args: - "cache --reload --check=all http://localhost:4548/subdir/redirects/a.ts", - output: "cache/redirect_cache.out", -}); - -itest!(ignore_require { - args: "cache --reload --no-check cache/ignore_require.js", - output_str: Some(""), - exit_code: 0, -}); - // This test only runs on linux, because it hardcodes the XDG_CACHE_HOME env var // which is only used on linux. #[cfg(target_os = "linux")] @@ -71,33 +26,6 @@ fn xdg_cache_home_dir() { assert!(xdg_cache_home.read_dir().count() > 0); } -itest!(check_local_by_default { - args: "cache --quiet cache/check_local_by_default.ts", - output: "cache/check_local_by_default.out", - http_server: true, -}); - -itest!(check_local_by_default2 { - args: "cache --quiet cache/check_local_by_default2.ts", - output: "cache/check_local_by_default2.out", - http_server: true, -}); - -itest!(json_import { - // should not error - args: "cache --quiet cache/json_import/main.ts", -}); - -itest!(package_json_basic { - args: "cache main.ts", - output: "package_json/basic/main.cache.out", - envs: env_vars_for_npm_tests(), - http_server: true, - cwd: Some("package_json/basic"), - copy_temp_dir: Some("package_json/basic"), - exit_code: 0, -}); - #[test] fn cache_matching_package_json_dep_should_not_install_all() { let context = TestContextBuilder::for_npm().use_temp_cwd().build(); diff --git a/tests/integration/check_tests.rs b/tests/integration/check_tests.rs index 72fb2d9b7..78ab859f9 100644 --- a/tests/integration/check_tests.rs +++ b/tests/integration/check_tests.rs @@ -6,24 +6,6 @@ use util::env_vars_for_npm_tests; use util::TestContext; use util::TestContextBuilder; -itest!(_095_check_with_bare_import { - args: "check cache/095_cache_with_bare_import.ts", - output: "cache/095_cache_with_bare_import.ts.out", - exit_code: 1, -}); - -itest!(check_extensionless { - args: "check --reload http://localhost:4545/subdir/no_js_ext", - output: "cache/cache_extensionless.out", - http_server: true, -}); - -itest!(check_random_extension { - args: "check --reload http://localhost:4545/subdir/no_js_ext@1.0.0", - output: "cache/cache_random_extension.out", - http_server: true, -}); - itest!(check_all { args: "check --quiet --all check/all/check_all.ts", output: "check/all/check_all.out", @@ -145,12 +127,6 @@ itest!(check_imported_files_listed_in_exclude_option { exit_code: 1, }); -itest!(check_with_excluded_file_specified { - args: "check lib/types.d.ts", - cwd: Some("check/excluded_file_specified/"), - output: "check/excluded_file_specified/check.out", -}); - #[test] fn cache_switching_config_then_no_config() { let context = TestContext::default(); @@ -279,13 +255,6 @@ itest!(check_dts { exit_code: 1, }); -itest!(check_types_dts { - args: "check main.ts", - cwd: Some("check/types_dts/"), - output: "check/types_dts/main.out", - exit_code: 0, -}); - itest!(package_json_basic { args: "check main.ts", output: "package_json/basic/main.check.out", diff --git a/tests/integration/doc_tests.rs b/tests/integration/doc_tests.rs index 8ebc46f32..605166ac2 100644 --- a/tests/integration/doc_tests.rs +++ b/tests/integration/doc_tests.rs @@ -106,21 +106,6 @@ itest!(deno_doc_invalid_url { exit_code: 1, }); -itest!(doc_lock { - args: "doc main.ts", - http_server: true, - cwd: Some("lockfile/basic"), - exit_code: 10, - output: "lockfile/basic/fail.out", -}); - -itest!(doc_no_lock { - args: "doc --no-lock main.ts", - http_server: true, - cwd: Some("lockfile/basic"), - output: "lockfile/basic/doc.nolock.out", -}); - #[test] fn deno_doc_html() { let context = TestContext::default(); diff --git a/tests/integration/info_tests.rs b/tests/integration/info_tests.rs index 4697cc2b8..a2e3c2d4f 100644 --- a/tests/integration/info_tests.rs +++ b/tests/integration/info_tests.rs @@ -100,21 +100,6 @@ itest!(info_missing_module { output: "info/info_missing_module.out", }); -itest!(info_lock { - args: "info main.ts", - http_server: true, - cwd: Some("lockfile/basic"), - exit_code: 10, - output: "lockfile/basic/fail.out", -}); - -itest!(info_no_lock { - args: "info --no-lock main.ts", - http_server: true, - cwd: Some("lockfile/basic"), - output: "lockfile/basic/info.nolock.out", -}); - itest!(info_recursive_modules { args: "info --quiet info/info_recursive_imports_test.ts", output: "info/info_recursive_imports_test.out", diff --git a/tests/integration/lint_tests.rs b/tests/integration/lint_tests.rs index a55fb1ef4..c0b1b4286 100644 --- a/tests/integration/lint_tests.rs +++ b/tests/integration/lint_tests.rs @@ -213,48 +213,6 @@ fn lint_with_glob_config_and_flags() { assert_contains!(output, "Checked 2 files"); } -itest!(no_slow_types { - args: "lint", - output: "lint/no_slow_types/no_slow_types.out", - cwd: Some("lint/no_slow_types"), - exit_code: 1, -}); - -itest!(no_slow_types_entrypoint { - args: "lint a.ts", - output: "lint/no_slow_types/no_slow_types_entrypoint.out", - cwd: Some("lint/no_slow_types"), - exit_code: 1, -}); - -itest!(no_slow_types_non_entrypoint { - args: "lint d.ts", - output_str: Some("Checked 1 file\n"), - cwd: Some("lint/no_slow_types"), - exit_code: 0, -}); - -itest!(no_slow_types_excluded { - args: "lint --rules-exclude=no-slow-types", - output_str: Some("Checked 4 files\n"), - cwd: Some("lint/no_slow_types"), - exit_code: 0, -}); - -itest!(no_slow_types_non_package { - args: "lint --config=deno.non-package.json", - output_str: Some("Checked 4 files\n"), - cwd: Some("lint/no_slow_types"), - exit_code: 0, -}); - -itest!(no_slow_types_workspace { - args: "lint", - output: "lint/no_slow_types_workspace/output.out", - cwd: Some("lint/no_slow_types_workspace"), - exit_code: 1, -}); - #[test] fn opt_out_top_level_exclude_via_lint_unexclude() { let context = TestContextBuilder::new().use_temp_cwd().build(); diff --git a/tests/integration/publish_tests.rs b/tests/integration/publish_tests.rs index a033f5d07..26acbd244 100644 --- a/tests/integration/publish_tests.rs +++ b/tests/integration/publish_tests.rs @@ -5,81 +5,11 @@ use std::process::Command; use deno_core::serde_json::json; use test_util::assert_contains; use test_util::assert_not_contains; -use test_util::env_vars_for_jsr_npm_tests; use test_util::env_vars_for_jsr_provenance_tests; use test_util::env_vars_for_jsr_tests; use test_util::env_vars_for_jsr_tests_with_git_check; -use test_util::env_vars_for_npm_tests; -use test_util::itest; use test_util::TestContextBuilder; -itest!(no_token { - args: "publish", - cwd: Some("publish/missing_deno_json"), - output: "publish/no_token.out", - envs: env_vars_for_jsr_tests(), - exit_code: 1, -}); - -itest!(missing_deno_json { - args: "publish --token 'sadfasdf'", - output: "publish/missing_deno_json.out", - cwd: Some("publish/missing_deno_json"), - envs: env_vars_for_jsr_tests(), - exit_code: 1, -}); - -itest!(has_slow_types { - args: "publish --token 'sadfasdf'", - output: "publish/has_slow_types.out", - cwd: Some("publish/has_slow_types"), - envs: env_vars_for_jsr_tests(), - exit_code: 1, -}); - -itest!(allow_slow_types { - args: "publish --allow-slow-types --token 'sadfasdf'", - output: "publish/allow_slow_types.out", - cwd: Some("publish/has_slow_types"), - envs: env_vars_for_jsr_tests(), - http_server: true, - exit_code: 0, -}); - -itest!(invalid_path { - args: "publish --token 'sadfasdf'", - output: "publish/invalid_path.out", - cwd: Some("publish/invalid_path"), - envs: env_vars_for_jsr_tests(), - exit_code: 1, -}); - -itest!(symlink { - args: "publish --token 'sadfasdf' --dry-run", - output: "publish/symlink.out", - cwd: Some("publish/symlink"), - envs: env_vars_for_jsr_tests(), - exit_code: 0, -}); - -itest!(invalid_import { - args: "publish --token 'sadfasdf' --dry-run", - output: "publish/invalid_import.out", - cwd: Some("publish/invalid_import"), - envs: env_vars_for_jsr_npm_tests(), - exit_code: 1, - http_server: true, -}); - -itest!(invalid_import_esm_sh_suggestion { - args: "publish --token 'sadfasdf' --dry-run", - output: "publish/invalid_import_esm_sh_suggestion.out", - cwd: Some("publish/invalid_import_esm_sh_suggestion"), - envs: env_vars_for_jsr_npm_tests(), - exit_code: 1, - http_server: true, -}); - #[test] fn publish_non_exported_files_using_import_map() { let context = publish_context_builder().build(); @@ -139,191 +69,19 @@ fn publish_warning_not_in_graph() { ); } -itest!(javascript_missing_decl_file { - args: "publish --token 'sadfasdf'", - output: "publish/javascript_missing_decl_file.out", - cwd: Some("publish/javascript_missing_decl_file"), - envs: env_vars_for_jsr_tests(), - exit_code: 0, - http_server: true, -}); - -itest!(unanalyzable_dynamic_import { - args: "publish --token 'sadfasdf'", - output: "publish/unanalyzable_dynamic_import.out", - cwd: Some("publish/unanalyzable_dynamic_import"), - envs: env_vars_for_jsr_tests(), - exit_code: 0, - http_server: true, -}); - -itest!(javascript_decl_file { - args: "publish --token 'sadfasdf'", - output: "publish/javascript_decl_file.out", - cwd: Some("publish/javascript_decl_file"), - envs: env_vars_for_jsr_tests(), - http_server: true, - exit_code: 0, -}); - -itest!(package_json { - args: "publish --token 'sadfasdf'", - output: "publish/package_json.out", - cwd: Some("publish/package_json"), - envs: env_vars_for_jsr_npm_tests(), - http_server: true, -}); - -itest!(successful { - args: "publish --token 'sadfasdf'", - output: "publish/successful.out", - cwd: Some("publish/successful"), - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(provenance { - args: "publish", - output: "publish/successful_provenance.out", - cwd: Some("publish/successful"), - envs: env_vars_for_jsr_provenance_tests(), - http_server: true, -}); - -itest!(no_check { - args: "publish --token 'sadfasdf' --no-check", - // still type checks the slow types output though - output: "publish/successful_no_check.out", - cwd: Some("publish/successful"), - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(node_specifier { - args: "publish --token 'sadfasdf'", - output: "publish/node_specifier.out", - cwd: Some("publish/node_specifier"), - envs: env_vars_for_jsr_tests() - .into_iter() - .chain(env_vars_for_npm_tests().into_iter()) - .collect(), - http_server: true, -}); - -itest!(config_file_jsonc { - args: "publish --token 'sadfasdf'", - output: "publish/deno_jsonc.out", - cwd: Some("publish/deno_jsonc"), - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(workspace_all { - args: "publish --token 'sadfasdf'", - output: "publish/workspace.out", - cwd: Some("publish/workspace"), - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(workspace_individual { - args: "publish --token 'sadfasdf'", - output: "publish/workspace_individual.out", - cwd: Some("publish/workspace/bar"), - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(dry_run { - args: "publish --token 'sadfasdf' --dry-run", - cwd: Some("publish/successful"), - output: "publish/dry_run.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(config_flag { - args: "publish --token 'sadfasdf' --config=successful/deno.json", - output: "publish/successful.out", - cwd: Some("publish"), - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(bare_node_builtins { - args: "publish --token 'sadfasdf' --dry-run --unstable-bare-node-builtins", - output: "publish/bare_node_builtins.out", - cwd: Some("publish/bare_node_builtins"), - envs: env_vars_for_jsr_npm_tests(), - http_server: true, -}); - -itest!(bare_node_builtins_warning_no_warnings { - args: "publish --token 'sadfasdf' --dry-run --unstable-bare-node-builtins", - output: "publish/bare_node_builtins_no_warnings.out", - cwd: Some("publish/bare_node_builtins"), - envs: env_vars_for_jsr_npm_tests() - .into_iter() - .chain( - vec![( - "DENO_DISABLE_PEDANTIC_NODE_WARNINGS".to_string(), - "1".to_string() - )] - .into_iter() - ) - .collect(), - http_server: true, -}); - -itest!(sloppy_imports { - args: "publish --token 'sadfasdf' --dry-run --unstable-sloppy-imports", - output: "publish/sloppy_imports.out", - cwd: Some("publish/sloppy_imports"), - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(sloppy_imports_not_enabled { - args: "publish --token 'sadfasdf' --dry-run", - output: "publish/sloppy_imports_not_enabled.out", - cwd: Some("publish/sloppy_imports"), - envs: env_vars_for_jsr_tests(), - http_server: true, - exit_code: 1, -}); - -itest!(sloppy_imports_no_warnings { - args: "publish --token 'sadfasdf' --dry-run --unstable-sloppy-imports", - output: "publish/sloppy_imports_no_warnings.out", - cwd: Some("publish/sloppy_imports"), - envs: env_vars_for_jsr_tests() - .into_iter() - .chain( - vec![( - "DENO_DISABLE_PEDANTIC_NODE_WARNINGS".to_string(), - "1".to_string() - )] - .into_iter() - ) - .collect(), - http_server: true, -}); - -itest!(jsr_jsonc { - args: "publish --token 'sadfasdf'", - cwd: Some("publish/jsr_jsonc"), - output: "publish/jsr_jsonc/mod.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(unsupported_jsx_tsx { - args: "publish --token 'sadfasdf'", - cwd: Some("publish/unsupported_jsx_tsx"), - output: "publish/unsupported_jsx_tsx/mod.out", - envs: env_vars_for_jsr_npm_tests(), - http_server: true, -}); +#[test] +fn provenance() { + TestContextBuilder::new() + .use_http_server() + .envs(env_vars_for_jsr_provenance_tests()) + .cwd("publish/successful") + .build() + .new_command() + .args("publish") + .run() + .assert_exit_code(0) + .assert_matches_file("publish/successful_provenance.out"); +} #[test] fn ignores_gitignore() { @@ -629,20 +387,6 @@ fn not_includes_vendor_dir_only_when_vendor_true() { } } -fn publish_context_builder() -> TestContextBuilder { - TestContextBuilder::new() - .use_http_server() - .envs(env_vars_for_jsr_tests()) - .use_temp_cwd() -} - -fn publish_context_builder_with_git_checks() -> TestContextBuilder { - TestContextBuilder::new() - .use_http_server() - .envs(env_vars_for_jsr_tests_with_git_check()) - .use_temp_cwd() -} - #[test] fn allow_dirty() { let context = publish_context_builder_with_git_checks().build(); @@ -739,3 +483,17 @@ fn allow_dirty_dry_run() { let output = output.combined_output(); assert_contains!(output, "Aborting due to uncommitted changes. Check in source code or run with --allow-dirty"); } + +fn publish_context_builder() -> TestContextBuilder { + TestContextBuilder::new() + .use_http_server() + .envs(env_vars_for_jsr_tests()) + .use_temp_cwd() +} + +fn publish_context_builder_with_git_checks() -> TestContextBuilder { + TestContextBuilder::new() + .use_http_server() + .envs(env_vars_for_jsr_tests_with_git_check()) + .use_temp_cwd() +} diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index eec10f64f..4d9116268 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -3439,17 +3439,6 @@ itest!(config_not_auto_discovered_for_remote_script { http_server: true, }); -itest!(package_json_auto_discovered_for_local_script_arg { - args: "run -L debug -A no_deno_json/main.ts", - output: "run/with_package_json/no_deno_json/main.out", - // notice this is not in no_deno_json - cwd: Some("run/with_package_json/"), - // prevent creating a node_modules dir in the code directory - copy_temp_dir: Some("run/with_package_json/"), - envs: env_vars_for_npm_tests(), - http_server: true, -}); - // In this case we shouldn't discover `package.json` file, because it's in a // directory that is above the directory containing `deno.json` file. itest!( @@ -3464,36 +3453,6 @@ itest!( } ); -itest!(package_json_not_auto_discovered_no_config { - args: "run -L debug -A --no-config noconfig.ts", - output: "run/with_package_json/no_deno_json/noconfig.out", - cwd: Some("run/with_package_json/no_deno_json/"), -}); - -itest!(package_json_not_auto_discovered_no_npm { - args: "run -L debug -A --no-npm noconfig.ts", - output: "run/with_package_json/no_deno_json/noconfig.out", - cwd: Some("run/with_package_json/no_deno_json/"), -}); - -itest!(package_json_not_auto_discovered_env_var { - args: "run -L debug -A noconfig.ts", - output: "run/with_package_json/no_deno_json/noconfig.out", - cwd: Some("run/with_package_json/no_deno_json/"), - envs: vec![("DENO_NO_PACKAGE_JSON".to_string(), "1".to_string())], -}); - -itest!( - package_json_auto_discovered_node_modules_relative_package_json { - args: "run -A main.js", - output: "run/with_package_json/no_deno_json/sub_dir/main.out", - cwd: Some("run/with_package_json/no_deno_json/sub_dir"), - copy_temp_dir: Some("run/with_package_json/no_deno_json/"), - envs: env_vars_for_npm_tests(), - http_server: true, - } -); - itest!(package_json_auto_discovered_for_npm_binary { args: "run -L debug -A npm:@denotest/bin/cli-esm this is a test", output: "run/with_package_json/npm_binary/main.out", @@ -3503,14 +3462,6 @@ itest!(package_json_auto_discovered_for_npm_binary { http_server: true, }); -itest!(package_json_auto_discovered_no_package_json_imports { - // this should not use --quiet because we should ensure no package.json install occurs - args: "run -A no_package_json_imports.ts", - output: "run/with_package_json/no_deno_json/no_package_json_imports.out", - cwd: Some("run/with_package_json/no_deno_json"), - copy_temp_dir: Some("run/with_package_json/no_deno_json"), -}); - #[test] fn package_json_with_deno_json() { let context = TestContextBuilder::for_npm() diff --git a/tests/integration/test_tests.rs b/tests/integration/test_tests.rs index 2bf2b3109..fe9eb83c5 100644 --- a/tests/integration/test_tests.rs +++ b/tests/integration/test_tests.rs @@ -584,21 +584,6 @@ itest!(package_json_basic { exit_code: 0, }); -itest!(test_lock { - args: "test", - http_server: true, - cwd: Some("lockfile/basic"), - exit_code: 10, - output: "lockfile/basic/fail.out", -}); - -itest!(test_no_lock { - args: "test --no-lock", - http_server: true, - cwd: Some("lockfile/basic"), - output: "lockfile/basic/test.nolock.out", -}); - itest!(test_replace_timers { args: "test test/replace_timers.js", output: "test/replace_timers.js.out", @@ -676,12 +661,6 @@ fn conditionally_loads_type_graph() { assert_not_contains!(output.combined_output(), "type_reference.d.ts"); } -itest!(test_include_relative_pattern_dot_slash { - args: "test", - output: "test/relative_pattern_dot_slash/output.out", - cwd: Some("test/relative_pattern_dot_slash"), -}); - #[test] fn opt_out_top_level_exclude_via_test_unexclude() { let context = TestContextBuilder::new().use_temp_cwd().build(); diff --git a/tests/specs/README.md b/tests/specs/README.md index 55880fe23..5711b41d5 100644 --- a/tests/specs/README.md +++ b/tests/specs/README.md @@ -78,6 +78,7 @@ a "steps" array. - `output` - Path to use to assert the output. - `cleanDenoDir` (boolean) - Whether to empty the deno_dir before running the step. +- `flaky` - Step should be repeated until success a maximum of 3 times. - `if` (`"windows"`, `"linux"`, `"mac"`, `"unix"`) - Whether to run this step. - `exitCode` (number) - Expected exit code. diff --git a/tests/specs/bench/allow_all/__test__.jsonc b/tests/specs/bench/allow_all/__test__.jsonc new file mode 100644 index 000000000..dcc5cc421 --- /dev/null +++ b/tests/specs/bench/allow_all/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --allow-all allow_all.ts", + "output": "allow_all.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/allow_all/allow_all.out b/tests/specs/bench/allow_all/allow_all.out new file mode 100644 index 000000000..0c6a8a034 --- /dev/null +++ b/tests/specs/bench/allow_all/allow_all.out @@ -0,0 +1,23 @@ +[WILDCARD] +Check [WILDLINE]/allow_all.ts +cpu: [WILDLINE] +runtime: deno [WILDLINE] ([WILDLINE]) + +[WILDLINE]/allow_all.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +------------------------------------------------------------------ ----------------------------- +read false [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +read true [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +write false [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +write true [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +net false [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +net true [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +env false [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +env true [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +run false [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +run true [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +ffi false [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +ffi true [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +hrtime false [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] +hrtime true [WILDLINE] [WILDLINE]/iter[WILDLINE]([WILDLINE] … [WILDLINE]) [WILDLINE] + diff --git a/tests/specs/bench/allow_all/allow_all.ts b/tests/specs/bench/allow_all/allow_all.ts new file mode 100644 index 000000000..9747fb414 --- /dev/null +++ b/tests/specs/bench/allow_all/allow_all.ts @@ -0,0 +1,43 @@ +import { assertEquals } from "jsr:@std/assert"; + +const permissions: Deno.PermissionName[] = [ + "read", + "write", + "net", + "env", + "run", + "ffi", + "hrtime", +]; + +for (const name of permissions) { + Deno.bench({ + name: `${name} false`, + permissions: { + [name]: false, + }, + async fn() { + for await (const n of permissions) { + const status = await Deno.permissions.query({ name: n }); + assertEquals(status.state, "prompt"); + } + }, + }); + + Deno.bench({ + name: `${name} true`, + permissions: { + [name]: true, + }, + async fn() { + for await (const n of permissions) { + const status = await Deno.permissions.query({ name: n }); + if (n === name) { + assertEquals(status.state, "granted"); + } else { + assertEquals(status.state, "prompt"); + } + } + }, + }); +} diff --git a/tests/specs/bench/allow_none/__test__.jsonc b/tests/specs/bench/allow_none/__test__.jsonc new file mode 100644 index 000000000..9ae51f75b --- /dev/null +++ b/tests/specs/bench/allow_none/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench allow_none.ts", + "output": "allow_none.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/allow_none/allow_none.out b/tests/specs/bench/allow_none/allow_none.out new file mode 100644 index 000000000..cfe86adcb --- /dev/null +++ b/tests/specs/bench/allow_none/allow_none.out @@ -0,0 +1,22 @@ +Check [WILDLINE]/allow_none.ts +cpu: [WILDLINE] +runtime: deno [WILDLINE] ([WILDLINE]) + +[WILDLINE]/allow_none.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +read error: PermissionDenied: Can't escalate parent thread permissions +[WILDCARD] +write error: PermissionDenied: Can't escalate parent thread permissions +[WILDCARD] +net error: PermissionDenied: Can't escalate parent thread permissions +[WILDCARD] +env error: PermissionDenied: Can't escalate parent thread permissions +[WILDCARD] +run error: PermissionDenied: Can't escalate parent thread permissions +[WILDCARD] +ffi error: PermissionDenied: Can't escalate parent thread permissions +[WILDCARD] +hrtime error: PermissionDenied: Can't escalate parent thread permissions +[WILDCARD] +error: Bench failed diff --git a/tests/specs/bench/allow_none/allow_none.ts b/tests/specs/bench/allow_none/allow_none.ts new file mode 100644 index 000000000..77f86f256 --- /dev/null +++ b/tests/specs/bench/allow_none/allow_none.ts @@ -0,0 +1,21 @@ +const permissions: Deno.PermissionName[] = [ + "read", + "write", + "net", + "env", + "run", + "ffi", + "hrtime", +]; + +for (const name of permissions) { + Deno.bench({ + name, + permissions: { + [name]: true, + }, + fn() { + throw new Error("unreachable"); + }, + }); +} diff --git a/tests/specs/bench/before_unload_prevent_default/__test__.jsonc b/tests/specs/bench/before_unload_prevent_default/__test__.jsonc new file mode 100644 index 000000000..5253af5df --- /dev/null +++ b/tests/specs/bench/before_unload_prevent_default/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "bench --quiet before_unload_prevent_default.ts", + "output": "before_unload_prevent_default.out" +} diff --git a/tests/specs/bench/before_unload_prevent_default/before_unload_prevent_default.out b/tests/specs/bench/before_unload_prevent_default/before_unload_prevent_default.out new file mode 100644 index 000000000..dcb6d8194 --- /dev/null +++ b/tests/specs/bench/before_unload_prevent_default/before_unload_prevent_default.out @@ -0,0 +1,7 @@ +cpu: [WILDCARD] +runtime: deno [WILDCARD] + +[WILDCARD]/before_unload_prevent_default.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +foo [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] diff --git a/tests/specs/bench/before_unload_prevent_default/before_unload_prevent_default.ts b/tests/specs/bench/before_unload_prevent_default/before_unload_prevent_default.ts new file mode 100644 index 000000000..2759d4659 --- /dev/null +++ b/tests/specs/bench/before_unload_prevent_default/before_unload_prevent_default.ts @@ -0,0 +1,6 @@ +addEventListener("beforeunload", (e) => { + // The worker should be killed once benchmarks are done regardless of this. + e.preventDefault(); +}); + +Deno.bench("foo", () => {}); diff --git a/tests/specs/bench/bench_explicit_start_end/__test__.jsonc b/tests/specs/bench/bench_explicit_start_end/__test__.jsonc new file mode 100644 index 000000000..e8e5bf8c2 --- /dev/null +++ b/tests/specs/bench/bench_explicit_start_end/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --quiet -A explicit_start_and_end.ts", + "output": "explicit_start_and_end.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/bench_explicit_start_end/explicit_start_and_end.out b/tests/specs/bench/bench_explicit_start_end/explicit_start_and_end.out new file mode 100644 index 000000000..fa118540c --- /dev/null +++ b/tests/specs/bench/bench_explicit_start_end/explicit_start_and_end.out @@ -0,0 +1,25 @@ +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/explicit_start_and_end.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +------------------------------------------------------------------- ----------------------------- +start and end [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +start only [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +end only [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +double start error: TypeError: BenchContext::start() has already been invoked. + t.start(); + ^ + at BenchContext.start ([WILDCARD]) + at [WILDCARD]/explicit_start_and_end.ts:[WILDCARD] +double end error: TypeError: BenchContext::end() has already been invoked. + t.end(); + ^ + at BenchContext.end ([WILDCARD]) + at [WILDCARD]/explicit_start_and_end.ts:[WILDCARD] +captured error: TypeError: The benchmark which this context belongs to is not being executed. + captured!.start(); + ^ + at BenchContext.start ([WILDCARD]) + at [WILDCARD]/explicit_start_and_end.ts:[WILDCARD] +error: Bench failed diff --git a/tests/specs/bench/bench_explicit_start_end/explicit_start_and_end.ts b/tests/specs/bench/bench_explicit_start_end/explicit_start_and_end.ts new file mode 100644 index 000000000..60a3d10d7 --- /dev/null +++ b/tests/specs/bench/bench_explicit_start_end/explicit_start_and_end.ts @@ -0,0 +1,50 @@ +Deno.bench("start and end", (t) => { + const id = setInterval(() => {}, 1000); + t.start(); + Deno.inspect(id); + t.end(); + clearInterval(id); +}); + +Deno.bench("start only", (t) => { + const id = setInterval(() => {}, 1000); + t.start(); + Deno.inspect(id); + clearInterval(id); +}); + +Deno.bench("end only", (t) => { + const id = setInterval(() => {}, 1000); + Deno.inspect(id); + t.end(); + clearInterval(id); +}); + +Deno.bench("double start", (t) => { + const id = setInterval(() => {}, 1000); + t.start(); + t.start(); + Deno.inspect(id); + t.end(); + clearInterval(id); +}); + +let captured: Deno.BenchContext; + +Deno.bench("double end", (t) => { + captured = t; + const id = setInterval(() => {}, 1000); + t.start(); + Deno.inspect(id); + t.end(); + t.end(); + clearInterval(id); +}); + +Deno.bench("captured", () => { + const id = setInterval(() => {}, 1000); + captured!.start(); + Deno.inspect(id); + captured!.end(); + clearInterval(id); +}); diff --git a/tests/specs/bench/bench_formatting/__test__.jsonc b/tests/specs/bench/bench_formatting/__test__.jsonc new file mode 100644 index 000000000..1f1d89394 --- /dev/null +++ b/tests/specs/bench/bench_formatting/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench bench_formatting.ts", + "output": "bench_formatting.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/bench_formatting/bench_formatting.out b/tests/specs/bench/bench_formatting/bench_formatting.out new file mode 100644 index 000000000..79617a32d --- /dev/null +++ b/tests/specs/bench/bench_formatting/bench_formatting.out @@ -0,0 +1,8 @@ +Check [WILDCARD]/bench_formatting.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/bench_formatting.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +[WILDCARD] [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] \ No newline at end of file diff --git a/tests/specs/bench/bench_formatting/bench_formatting.ts b/tests/specs/bench/bench_formatting/bench_formatting.ts new file mode 100644 index 000000000..fdee15abb --- /dev/null +++ b/tests/specs/bench/bench_formatting/bench_formatting.ts @@ -0,0 +1,3 @@ +Deno.bench("Date.now", () => { + Date.now(); +}); diff --git a/tests/specs/bench/check_local_by_default/__test__.jsonc b/tests/specs/bench/check_local_by_default/__test__.jsonc new file mode 100644 index 000000000..76dd80b7b --- /dev/null +++ b/tests/specs/bench/check_local_by_default/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "bench --quiet check_local_by_default.ts", + "output": "check_local_by_default.out" +} diff --git a/tests/specs/bench/check_local_by_default/check_local_by_default.out b/tests/specs/bench/check_local_by_default/check_local_by_default.out new file mode 100644 index 000000000..63a6b5fa5 --- /dev/null +++ b/tests/specs/bench/check_local_by_default/check_local_by_default.out @@ -0,0 +1,6 @@ +[WILDCARD] + +[WILDCARD]/check_local_by_default.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + diff --git a/tests/specs/bench/check_local_by_default/check_local_by_default.ts b/tests/specs/bench/check_local_by_default/check_local_by_default.ts new file mode 100644 index 000000000..2ae8c2692 --- /dev/null +++ b/tests/specs/bench/check_local_by_default/check_local_by_default.ts @@ -0,0 +1,3 @@ +import * as a from "http://localhost:4545/subdir/type_error.ts"; + +console.log(a.a); diff --git a/tests/specs/bench/check_local_by_default2/__test__.jsonc b/tests/specs/bench/check_local_by_default2/__test__.jsonc new file mode 100644 index 000000000..5f2366d1e --- /dev/null +++ b/tests/specs/bench/check_local_by_default2/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --quiet check_local_by_default2.ts", + "output": "check_local_by_default2.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/check_local_by_default2/check_local_by_default2.out b/tests/specs/bench/check_local_by_default2/check_local_by_default2.out new file mode 100644 index 000000000..089b17f4b --- /dev/null +++ b/tests/specs/bench/check_local_by_default2/check_local_by_default2.out @@ -0,0 +1,4 @@ +error: TS2322 [ERROR]: Type '12' is not assignable to type '"b"'. +const b: "b" = 12; + ^ + at [WILDCARD]/check_local_by_default2.ts:3:7 diff --git a/tests/specs/bench/check_local_by_default2/check_local_by_default2.ts b/tests/specs/bench/check_local_by_default2/check_local_by_default2.ts new file mode 100644 index 000000000..5177ff944 --- /dev/null +++ b/tests/specs/bench/check_local_by_default2/check_local_by_default2.ts @@ -0,0 +1,6 @@ +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/specs/bench/clear_timeout/__test__.jsonc b/tests/specs/bench/clear_timeout/__test__.jsonc new file mode 100644 index 000000000..4535c931d --- /dev/null +++ b/tests/specs/bench/clear_timeout/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench clear_timeout.ts", + "output": "clear_timeout.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/clear_timeout/clear_timeout.out b/tests/specs/bench/clear_timeout/clear_timeout.out new file mode 100644 index 000000000..48a31378b --- /dev/null +++ b/tests/specs/bench/clear_timeout/clear_timeout.out @@ -0,0 +1,10 @@ +Check [WILDCARD]/clear_timeout.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/clear_timeout.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +bench1 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench2 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] diff --git a/tests/specs/bench/clear_timeout/clear_timeout.ts b/tests/specs/bench/clear_timeout/clear_timeout.ts new file mode 100644 index 000000000..4148263ac --- /dev/null +++ b/tests/specs/bench/clear_timeout/clear_timeout.ts @@ -0,0 +1,5 @@ +clearTimeout(setTimeout(() => {}, 1000)); + +Deno.bench("bench1", () => {}); +Deno.bench("bench2", () => {}); +Deno.bench("bench3", () => {}); diff --git a/tests/specs/bench/collect/__test__.jsonc b/tests/specs/bench/collect/__test__.jsonc new file mode 100644 index 000000000..e5aabd82d --- /dev/null +++ b/tests/specs/bench/collect/__test__.jsonc @@ -0,0 +1,19 @@ +{ + "steps": [{ + "args": "bench --ignore=collect/ignore collect", + "output": "collect.out" + }, { + "cleanDenoDir": true, + "args": "bench --config collect/deno.jsonc collect", + "output": "collect.out" + }, { + "cleanDenoDir": true, + "args": "bench --config collect/deno2.jsonc collect", + "output": "collect2.out" + }, { + "cleanDenoDir": true, + "args": "bench --config collect/deno.malformed.jsonc", + "exitCode": 1, + "output": "collect_with_malformed_config.out" + }] +} diff --git a/tests/specs/bench/collect/collect.out b/tests/specs/bench/collect/collect.out new file mode 100644 index 000000000..0d3f7a8ff --- /dev/null +++ b/tests/specs/bench/collect/collect.out @@ -0,0 +1,18 @@ +Check [WILDCARD]/collect/bench.ts +Check [WILDCARD]/collect/include/2_bench.ts +Check [WILDCARD]/collect/include/bench.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/collect/bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + +[WILDCARD]/collect/include/2_bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + +[WILDCARD]/collect/include/bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + diff --git a/tests/specs/bench/collect/collect/bench.ts b/tests/specs/bench/collect/collect/bench.ts new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/bench/collect/collect/deno.jsonc b/tests/specs/bench/collect/collect/deno.jsonc new file mode 100644 index 000000000..7f8f190d3 --- /dev/null +++ b/tests/specs/bench/collect/collect/deno.jsonc @@ -0,0 +1,5 @@ +{ + "bench": { + "exclude": ["./ignore"] + } +} diff --git a/tests/specs/bench/collect/collect/deno.malformed.jsonc b/tests/specs/bench/collect/collect/deno.malformed.jsonc new file mode 100644 index 000000000..8e558fbcf --- /dev/null +++ b/tests/specs/bench/collect/collect/deno.malformed.jsonc @@ -0,0 +1,5 @@ +{ + "bench": { + "dont_know_this_field": {} + } +} diff --git a/tests/specs/bench/collect/collect/deno2.jsonc b/tests/specs/bench/collect/collect/deno2.jsonc new file mode 100644 index 000000000..653ab1e31 --- /dev/null +++ b/tests/specs/bench/collect/collect/deno2.jsonc @@ -0,0 +1,6 @@ +{ + "bench": { + "include": ["./include/"], + "exclude": ["./ignore", "./include/2_bench.ts"] + } +} diff --git a/tests/specs/bench/collect/collect/ignore/bench.ts b/tests/specs/bench/collect/collect/ignore/bench.ts new file mode 100644 index 000000000..16fb63ba7 --- /dev/null +++ b/tests/specs/bench/collect/collect/ignore/bench.ts @@ -0,0 +1 @@ +throw new Error("this module should be ignored"); diff --git a/tests/specs/bench/collect/collect/include/2_bench.ts b/tests/specs/bench/collect/collect/include/2_bench.ts new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/bench/collect/collect/include/bench.ts b/tests/specs/bench/collect/collect/include/bench.ts new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/bench/collect/collect2.out b/tests/specs/bench/collect/collect2.out new file mode 100644 index 000000000..49ceee996 --- /dev/null +++ b/tests/specs/bench/collect/collect2.out @@ -0,0 +1,13 @@ +Check [WILDCARD]/collect/bench.ts +Check [WILDCARD]/collect/include/bench.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/collect/bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + +[WILDCARD]/collect/include/bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + diff --git a/tests/specs/bench/collect/collect_with_malformed_config.out b/tests/specs/bench/collect/collect_with_malformed_config.out new file mode 100644 index 000000000..92e5e29d2 --- /dev/null +++ b/tests/specs/bench/collect/collect_with_malformed_config.out @@ -0,0 +1,4 @@ +error: Failed to parse "bench" configuration + +Caused by: + unknown field `dont_know_this_field`, expected one of `include`, `exclude`, `files` diff --git a/tests/specs/bench/exit_sanitizer/__test__.jsonc b/tests/specs/bench/exit_sanitizer/__test__.jsonc new file mode 100644 index 000000000..a14531651 --- /dev/null +++ b/tests/specs/bench/exit_sanitizer/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench exit_sanitizer.ts", + "output": "exit_sanitizer.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/exit_sanitizer/exit_sanitizer.out b/tests/specs/bench/exit_sanitizer/exit_sanitizer.out new file mode 100644 index 000000000..eefc86e60 --- /dev/null +++ b/tests/specs/bench/exit_sanitizer/exit_sanitizer.out @@ -0,0 +1,14 @@ +Check [WILDCARD]/exit_sanitizer.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/exit_sanitizer.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +exit(0) error: Error: Bench attempted to exit with exit code: 0 +[WILDCARD] +exit(1) error: Error: Bench attempted to exit with exit code: 1 +[WILDCARD] +exit(2) error: Error: Bench attempted to exit with exit code: 2 +[WILDCARD] +error: Bench failed diff --git a/tests/specs/bench/exit_sanitizer/exit_sanitizer.ts b/tests/specs/bench/exit_sanitizer/exit_sanitizer.ts new file mode 100644 index 000000000..8e596b310 --- /dev/null +++ b/tests/specs/bench/exit_sanitizer/exit_sanitizer.ts @@ -0,0 +1,11 @@ +Deno.bench("exit(0)", function () { + Deno.exit(0); +}); + +Deno.bench("exit(1)", function () { + Deno.exit(1); +}); + +Deno.bench("exit(2)", function () { + Deno.exit(2); +}); diff --git a/tests/specs/bench/explicit_start_and_end_low_precision/__test__.jsonc b/tests/specs/bench/explicit_start_and_end_low_precision/__test__.jsonc new file mode 100644 index 000000000..2cd093f3f --- /dev/null +++ b/tests/specs/bench/explicit_start_and_end_low_precision/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --quiet -A main.bench.ts", + "output": "main.bench.out", + "flaky": true +} diff --git a/tests/specs/bench/explicit_start_and_end_low_precision/main.bench.out b/tests/specs/bench/explicit_start_and_end_low_precision/main.bench.out new file mode 100644 index 000000000..516c001b1 --- /dev/null +++ b/tests/specs/bench/explicit_start_and_end_low_precision/main.bench.out @@ -0,0 +1,10 @@ +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/main.bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +----------------------------------------------------------------------------- ----------------------------- +noop with start and end [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +Warning: start() and end() calls in "noop with start and end" are ignored because it averages less +than 10µs per iteration. Remove them for better results. + diff --git a/tests/specs/bench/explicit_start_and_end_low_precision/main.bench.ts b/tests/specs/bench/explicit_start_and_end_low_precision/main.bench.ts new file mode 100644 index 000000000..23bdf19fe --- /dev/null +++ b/tests/specs/bench/explicit_start_and_end_low_precision/main.bench.ts @@ -0,0 +1,4 @@ +Deno.bench("noop with start and end", (b) => { + b.start(); + b.end(); +}); diff --git a/tests/specs/bench/fail/__test__.jsonc b/tests/specs/bench/fail/__test__.jsonc new file mode 100644 index 000000000..18748c31e --- /dev/null +++ b/tests/specs/bench/fail/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench fail.ts", + "output": "fail.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/fail/fail.out b/tests/specs/bench/fail/fail.out new file mode 100644 index 000000000..03f04cf4f --- /dev/null +++ b/tests/specs/bench/fail/fail.out @@ -0,0 +1,28 @@ +Check [WILDCARD]/fail.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/fail.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +bench0 error: Error +[WILDCARD] +bench1 error: Error +[WILDCARD] +bench2 error: Error +[WILDCARD] +bench3 error: Error +[WILDCARD] +bench4 error: Error +[WILDCARD] +bench5 error: Error +[WILDCARD] +bench6 error: Error +[WILDCARD] +bench7 error: Error +[WILDCARD] +bench8 error: Error +[WILDCARD] +bench9 error: Error +[WILDCARD] +error: Bench failed diff --git a/tests/specs/bench/fail/fail.ts b/tests/specs/bench/fail/fail.ts new file mode 100644 index 000000000..33d70ce55 --- /dev/null +++ b/tests/specs/bench/fail/fail.ts @@ -0,0 +1,30 @@ +Deno.bench("bench0", () => { + throw new Error(); +}); +Deno.bench("bench1", () => { + throw new Error(); +}); +Deno.bench("bench2", () => { + throw new Error(); +}); +Deno.bench("bench3", () => { + throw new Error(); +}); +Deno.bench("bench4", () => { + throw new Error(); +}); +Deno.bench("bench5", () => { + throw new Error(); +}); +Deno.bench("bench6", () => { + throw new Error(); +}); +Deno.bench("bench7", () => { + throw new Error(); +}); +Deno.bench("bench8", () => { + throw new Error(); +}); +Deno.bench("bench9", () => { + throw new Error(); +}); diff --git a/tests/specs/bench/filter/__test__.jsonc b/tests/specs/bench/filter/__test__.jsonc new file mode 100644 index 000000000..685ee9571 --- /dev/null +++ b/tests/specs/bench/filter/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "bench --filter=foo", + "output": "filter.out" +} diff --git a/tests/specs/bench/filter/a_bench.ts b/tests/specs/bench/filter/a_bench.ts new file mode 100644 index 000000000..fc4ef859c --- /dev/null +++ b/tests/specs/bench/filter/a_bench.ts @@ -0,0 +1,3 @@ +Deno.bench("foo", function () {}); +Deno.bench("bar", function () {}); +Deno.bench("baz", function () {}); diff --git a/tests/specs/bench/filter/b_bench.ts b/tests/specs/bench/filter/b_bench.ts new file mode 100644 index 000000000..fc4ef859c --- /dev/null +++ b/tests/specs/bench/filter/b_bench.ts @@ -0,0 +1,3 @@ +Deno.bench("foo", function () {}); +Deno.bench("bar", function () {}); +Deno.bench("baz", function () {}); diff --git a/tests/specs/bench/filter/c_bench.ts b/tests/specs/bench/filter/c_bench.ts new file mode 100644 index 000000000..fc4ef859c --- /dev/null +++ b/tests/specs/bench/filter/c_bench.ts @@ -0,0 +1,3 @@ +Deno.bench("foo", function () {}); +Deno.bench("bar", function () {}); +Deno.bench("baz", function () {}); diff --git a/tests/specs/bench/filter/filter.out b/tests/specs/bench/filter/filter.out new file mode 100644 index 000000000..970171e0b --- /dev/null +++ b/tests/specs/bench/filter/filter.out @@ -0,0 +1,20 @@ +Check [WILDCARD]/bench/filter/a_bench.ts +Check [WILDCARD]/bench/filter/b_bench.ts +Check [WILDCARD]/bench/filter/c_bench.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/bench/filter/a_bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +foo [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + +[WILDCARD]/bench/filter/b_bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +foo [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + +[WILDCARD]/bench/filter/c_bench.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +foo [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] diff --git a/tests/specs/bench/filter_group_header/main.out b/tests/specs/bench/filter_group_header/main.out index efe157f6c..5791538fe 100644 --- a/tests/specs/bench/filter_group_header/main.out +++ b/tests/specs/bench/filter_group_header/main.out @@ -7,7 +7,7 @@ benchmark time (avg) iter/s (min … max) p75 --------------------------------------------------------------- ----------------------------- group G1 -G1-B [WILDCARD] +G1-B [WILDCARD] group G2 -G2-B [WILDCARD] \ No newline at end of file +G2-B [WILDCARD] \ No newline at end of file diff --git a/tests/specs/bench/finally_timeout/__test__.jsonc b/tests/specs/bench/finally_timeout/__test__.jsonc new file mode 100644 index 000000000..621537204 --- /dev/null +++ b/tests/specs/bench/finally_timeout/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench finally_timeout.ts", + "output": "finally_timeout.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/finally_timeout/finally_timeout.out b/tests/specs/bench/finally_timeout/finally_timeout.out new file mode 100644 index 000000000..cefa18760 --- /dev/null +++ b/tests/specs/bench/finally_timeout/finally_timeout.out @@ -0,0 +1,11 @@ +Check [WILDCARD]/finally_timeout.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/finally_timeout.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +error error: Error: fail +[WILDCARD] +success [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +error: Bench failed diff --git a/tests/specs/bench/finally_timeout/finally_timeout.ts b/tests/specs/bench/finally_timeout/finally_timeout.ts new file mode 100644 index 000000000..c49eb8da2 --- /dev/null +++ b/tests/specs/bench/finally_timeout/finally_timeout.ts @@ -0,0 +1,11 @@ +Deno.bench("error", function () { + const timer = setTimeout(() => null, 10000); + try { + throw new Error("fail"); + } finally { + clearTimeout(timer); + } +}); + +Deno.bench("success", function () { +}); diff --git a/tests/specs/bench/group_baseline/__test__.jsonc b/tests/specs/bench/group_baseline/__test__.jsonc new file mode 100644 index 000000000..5874b40c8 --- /dev/null +++ b/tests/specs/bench/group_baseline/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench group_baseline.ts", + "output": "group_baseline.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/group_baseline/group_baseline.out b/tests/specs/bench/group_baseline/group_baseline.out new file mode 100644 index 000000000..54a6cd359 --- /dev/null +++ b/tests/specs/bench/group_baseline/group_baseline.out @@ -0,0 +1,20 @@ +[WILDCARD]/group_baseline.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +-------------------------------------------------------------------- ----------------------------- +noop [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +noop2 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + +summary + noo[WILDCARD] + [WILDCARD]x [WILDCARD] than noo[WILDCARD] + +group url +noop3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +parse url 2x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +parse url 200x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + +summary + parse url 2x + [WILDCARD]x slower than noop3 + [WILDCARD]x faster than parse url 200x + diff --git a/tests/specs/bench/group_baseline/group_baseline.ts b/tests/specs/bench/group_baseline/group_baseline.ts new file mode 100644 index 000000000..a86f6455c --- /dev/null +++ b/tests/specs/bench/group_baseline/group_baseline.ts @@ -0,0 +1,15 @@ +Deno.bench("noop", () => {}); +Deno.bench("noop2", { baseline: true }, () => {}); + +Deno.bench("noop3", { group: "url" }, () => {}); + +Deno.bench("parse url 2x", { group: "url", baseline: true }, () => { + new URL("https://deno.land/std/http/server.ts"); + new URL("https://deno.land/std/http/server.ts"); +}); + +Deno.bench("parse url 200x", { group: "url" }, () => { + for (let i = 0; i < 200; i++) { + new URL("https://deno.land/std/http/server.ts"); + } +}); diff --git a/tests/specs/bench/ignore/__test__.jsonc b/tests/specs/bench/ignore/__test__.jsonc new file mode 100644 index 000000000..97053bb79 --- /dev/null +++ b/tests/specs/bench/ignore/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench ignore.ts", + "output": "ignore.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/ignore/ignore.out b/tests/specs/bench/ignore/ignore.out new file mode 100644 index 000000000..d74a0c181 --- /dev/null +++ b/tests/specs/bench/ignore/ignore.out @@ -0,0 +1,8 @@ +Check [WILDCARD]/ignore.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/ignore.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + diff --git a/tests/specs/bench/ignore/ignore.ts b/tests/specs/bench/ignore/ignore.ts new file mode 100644 index 000000000..0226fe76f --- /dev/null +++ b/tests/specs/bench/ignore/ignore.ts @@ -0,0 +1,9 @@ +for (let i = 0; i < 10; i++) { + Deno.bench({ + name: `bench${i}`, + ignore: true, + fn() { + throw new Error("unreachable"); + }, + }); +} diff --git a/tests/specs/bench/ignore_permissions/__test__.jsonc b/tests/specs/bench/ignore_permissions/__test__.jsonc new file mode 100644 index 000000000..592ab0240 --- /dev/null +++ b/tests/specs/bench/ignore_permissions/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench ignore_permissions.ts", + "output": "ignore_permissions.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/ignore_permissions/ignore_permissions.out b/tests/specs/bench/ignore_permissions/ignore_permissions.out new file mode 100644 index 000000000..eb577fecc --- /dev/null +++ b/tests/specs/bench/ignore_permissions/ignore_permissions.out @@ -0,0 +1,8 @@ +Check [WILDCARD]/ignore_permissions.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/ignore_permissions.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + diff --git a/tests/specs/bench/ignore_permissions/ignore_permissions.ts b/tests/specs/bench/ignore_permissions/ignore_permissions.ts new file mode 100644 index 000000000..0dcd9299f --- /dev/null +++ b/tests/specs/bench/ignore_permissions/ignore_permissions.ts @@ -0,0 +1,16 @@ +Deno.bench({ + name: "ignore", + permissions: { + read: true, + write: true, + net: true, + env: true, + run: true, + ffi: true, + hrtime: true, + }, + ignore: true, + fn() { + throw new Error("unreachable"); + }, +}); diff --git a/tests/specs/bench/interval/__test__.jsonc b/tests/specs/bench/interval/__test__.jsonc new file mode 100644 index 000000000..f4e89c1b5 --- /dev/null +++ b/tests/specs/bench/interval/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench interval.ts", + "output": "interval.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/interval/interval.out b/tests/specs/bench/interval/interval.out new file mode 100644 index 000000000..11e440940 --- /dev/null +++ b/tests/specs/bench/interval/interval.out @@ -0,0 +1,8 @@ +Check [WILDCARD]/interval.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/interval.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + diff --git a/tests/specs/bench/interval/interval.ts b/tests/specs/bench/interval/interval.ts new file mode 100644 index 000000000..7eb588c59 --- /dev/null +++ b/tests/specs/bench/interval/interval.ts @@ -0,0 +1 @@ +setInterval(function () {}, 0); diff --git a/tests/specs/bench/json_output/__test__.jsonc b/tests/specs/bench/json_output/__test__.jsonc new file mode 100644 index 000000000..fa0dadcd0 --- /dev/null +++ b/tests/specs/bench/json_output/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --json pass.ts", + "output": "pass.json.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/json_output/pass.json.out b/tests/specs/bench/json_output/pass.json.out new file mode 100644 index 000000000..53259e758 --- /dev/null +++ b/tests/specs/bench/json_output/pass.json.out @@ -0,0 +1,28 @@ +Check file:///[WILDCARD]/pass.ts +{ + "runtime": "Deno/[WILDCARD]", + "cpu": "[WILDCARD]", + "benches": [ + { + "origin": "file:///[WILDCARD]/pass.ts", + "group": null, + "name": "bench0", + "baseline": false, + "results": [ + { + "ok": { + "n": [WILDCARD], + "min": [WILDCARD], + "max": [WILDCARD], + "avg": [WILDCARD], + "p75": [WILDCARD], + "p99": [WILDCARD], + "p995": [WILDCARD], + "p999": [WILDCARD] + } + } + ] + }, +[WILDCARD] + ] +} diff --git a/tests/specs/bench/json_output/pass.ts b/tests/specs/bench/json_output/pass.ts new file mode 100644 index 000000000..48348d447 --- /dev/null +++ b/tests/specs/bench/json_output/pass.ts @@ -0,0 +1,10 @@ +Deno.bench("bench0", () => {}); +Deno.bench("bench1", () => {}); +Deno.bench("bench2", () => {}); +Deno.bench("bench3", () => {}); +Deno.bench("bench4", () => {}); +Deno.bench("bench5", () => {}); +Deno.bench("bench6", () => {}); +Deno.bench("bench7", () => {}); +Deno.bench("bench8", () => {}); +Deno.bench("bench9", () => {}); diff --git a/tests/specs/bench/load_unload/__test__.jsonc b/tests/specs/bench/load_unload/__test__.jsonc new file mode 100644 index 000000000..8837d3d80 --- /dev/null +++ b/tests/specs/bench/load_unload/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench load_unload.ts", + "output": "load_unload.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/load_unload/load_unload.out b/tests/specs/bench/load_unload/load_unload.out new file mode 100644 index 000000000..99e4389ac --- /dev/null +++ b/tests/specs/bench/load_unload/load_unload.out @@ -0,0 +1,8 @@ +Check [WILDCARD]/load_unload.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/load_unload.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +bench [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] diff --git a/tests/specs/bench/load_unload/load_unload.ts b/tests/specs/bench/load_unload/load_unload.ts new file mode 100644 index 000000000..3653c135d --- /dev/null +++ b/tests/specs/bench/load_unload/load_unload.ts @@ -0,0 +1,22 @@ +let interval: number | null = null; +addEventListener("load", () => { + if (interval) { + throw new Error("Interval is already set"); + } + + interval = setInterval(() => {}, 0); +}); + +addEventListener("unload", () => { + if (!interval) { + throw new Error("Interval was not set"); + } + + clearInterval(interval); +}); + +Deno.bench("bench", () => { + if (!interval) { + throw new Error("Interval was not set"); + } +}); diff --git a/tests/specs/bench/meta/__test__.jsonc b/tests/specs/bench/meta/__test__.jsonc new file mode 100644 index 000000000..10a4ff3a4 --- /dev/null +++ b/tests/specs/bench/meta/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench meta.ts", + "output": "meta.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/meta/meta.out b/tests/specs/bench/meta/meta.out new file mode 100644 index 000000000..75a75984e --- /dev/null +++ b/tests/specs/bench/meta/meta.out @@ -0,0 +1,10 @@ +Check [WILDCARD]/meta.ts +import.meta.main: false +import.meta.url: [WILDCARD]/meta.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/meta.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- + diff --git a/tests/specs/bench/meta/meta.ts b/tests/specs/bench/meta/meta.ts new file mode 100644 index 000000000..e32fdeea6 --- /dev/null +++ b/tests/specs/bench/meta/meta.ts @@ -0,0 +1,2 @@ +console.log("import.meta.main: %s", import.meta.main); +console.log("import.meta.url: %s", import.meta.url); diff --git a/tests/specs/bench/multifile_summary/__test__.jsonc b/tests/specs/bench/multifile_summary/__test__.jsonc new file mode 100644 index 000000000..757af150b --- /dev/null +++ b/tests/specs/bench/multifile_summary/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench group_baseline.ts pass.ts multiple_group.ts", + "output": "multifile_summary.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/multifile_summary/group_baseline.ts b/tests/specs/bench/multifile_summary/group_baseline.ts new file mode 100644 index 000000000..a86f6455c --- /dev/null +++ b/tests/specs/bench/multifile_summary/group_baseline.ts @@ -0,0 +1,15 @@ +Deno.bench("noop", () => {}); +Deno.bench("noop2", { baseline: true }, () => {}); + +Deno.bench("noop3", { group: "url" }, () => {}); + +Deno.bench("parse url 2x", { group: "url", baseline: true }, () => { + new URL("https://deno.land/std/http/server.ts"); + new URL("https://deno.land/std/http/server.ts"); +}); + +Deno.bench("parse url 200x", { group: "url" }, () => { + for (let i = 0; i < 200; i++) { + new URL("https://deno.land/std/http/server.ts"); + } +}); diff --git a/tests/specs/bench/multifile_summary/multifile_summary.out b/tests/specs/bench/multifile_summary/multifile_summary.out new file mode 100644 index 000000000..c0439ebba --- /dev/null +++ b/tests/specs/bench/multifile_summary/multifile_summary.out @@ -0,0 +1,64 @@ +Check [WILDCARD]/group_baseline.ts +Check [WILDCARD]/pass.ts +Check [WILDCARD]/multiple_group.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/group_baseline.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +-------------------------------------------------------------------- ----------------------------- +noop [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +noop2 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + +summary + noo[WILDCARD] + [WILDCARD]x [WILDCARD] than noo[WILDCARD] + +group url +noop3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +parse url 2x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +parse url 200x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + +summary + parse url 2x + [WILDLINE]x slower than noop3 + [WILDLINE]x faster than parse url 200x + + +[WILDLINE]/pass.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +bench0 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench1 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench2 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench4 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench5 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench6 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench7 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench8 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench9 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + + +[WILDLINE]/multiple_group.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +-------------------------------------------------------------------- ----------------------------- + +group noop +noop [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +noop2 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + +summary + noo[WILDCARD] + [WILDCARD]x [WILDCARD] than noo[WILDCARD] + +group url +noop3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +parse url 2x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +parse url 200x [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] + +summary + parse url 2x + [WILDCARD]x slower than noop3 + [WILDCARD]x faster than parse url 200x + diff --git a/tests/specs/bench/multifile_summary/multiple_group.ts b/tests/specs/bench/multifile_summary/multiple_group.ts new file mode 100644 index 000000000..165b5e201 --- /dev/null +++ b/tests/specs/bench/multifile_summary/multiple_group.ts @@ -0,0 +1,15 @@ +Deno.bench("noop", { group: "noop" }, () => {}); +Deno.bench("noop2", { group: "noop", baseline: true }, () => {}); + +Deno.bench("noop3", { group: "url" }, () => {}); + +Deno.bench("parse url 2x", { group: "url", baseline: true }, () => { + new URL("https://jsr.io/@std/http/0.221.0/file_server.ts"); + new URL("https://jsr.io/@std/http/0.221.0/file_server.ts"); +}); + +Deno.bench("parse url 200x", { group: "url" }, () => { + for (let i = 0; i < 200; i++) { + new URL("https://jsr.io/@std/http/0.221.0/file_server.ts"); + } +}); diff --git a/tests/specs/bench/multifile_summary/pass.ts b/tests/specs/bench/multifile_summary/pass.ts new file mode 100644 index 000000000..48348d447 --- /dev/null +++ b/tests/specs/bench/multifile_summary/pass.ts @@ -0,0 +1,10 @@ +Deno.bench("bench0", () => {}); +Deno.bench("bench1", () => {}); +Deno.bench("bench2", () => {}); +Deno.bench("bench3", () => {}); +Deno.bench("bench4", () => {}); +Deno.bench("bench5", () => {}); +Deno.bench("bench6", () => {}); +Deno.bench("bench7", () => {}); +Deno.bench("bench8", () => {}); +Deno.bench("bench9", () => {}); diff --git a/tests/specs/bench/no_check/__test__.jsonc b/tests/specs/bench/no_check/__test__.jsonc new file mode 100644 index 000000000..d031e52de --- /dev/null +++ b/tests/specs/bench/no_check/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --no-check no_check.ts", + "output": "no_check.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/no_check/no_check.out b/tests/specs/bench/no_check/no_check.out new file mode 100644 index 000000000..c373c812c --- /dev/null +++ b/tests/specs/bench/no_check/no_check.out @@ -0,0 +1,9 @@ +error: (in promise) TypeError: Cannot read properties of undefined (reading 'fn') +Deno.bench(); + ^ + at [WILDCARD] + at [WILDCARD]/no_check.ts:1:6 +This error was not caught from a benchmark and caused the bench runner to fail on the referenced module. +It most likely originated from a dangling promise, event/timeout handler or top-level code. + +error: Bench failed diff --git a/tests/specs/bench/no_check/no_check.ts b/tests/specs/bench/no_check/no_check.ts new file mode 100644 index 000000000..b159cabd6 --- /dev/null +++ b/tests/specs/bench/no_check/no_check.ts @@ -0,0 +1 @@ +Deno.bench(); diff --git a/tests/specs/bench/no_prompt_by_default/__test__.jsonc b/tests/specs/bench/no_prompt_by_default/__test__.jsonc new file mode 100644 index 000000000..e3f4127da --- /dev/null +++ b/tests/specs/bench/no_prompt_by_default/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --quiet no_prompt_by_default.ts", + "output": "no_prompt_by_default.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/no_prompt_by_default/no_prompt_by_default.out b/tests/specs/bench/no_prompt_by_default/no_prompt_by_default.out new file mode 100644 index 000000000..7c5f2b5c2 --- /dev/null +++ b/tests/specs/bench/no_prompt_by_default/no_prompt_by_default.out @@ -0,0 +1,9 @@ +[WILDCARD]cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/no_prompt_by_default.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +no prompt error: PermissionDenied: Requires read access to "./some_file.txt", run again with the --allow-read flag +[WILDCARD] +error: Bench failed diff --git a/tests/specs/bench/no_prompt_by_default/no_prompt_by_default.ts b/tests/specs/bench/no_prompt_by_default/no_prompt_by_default.ts new file mode 100644 index 000000000..59359eebd --- /dev/null +++ b/tests/specs/bench/no_prompt_by_default/no_prompt_by_default.ts @@ -0,0 +1,3 @@ +Deno.bench("no prompt", async () => { + await Deno.readTextFile("./some_file.txt"); +}); diff --git a/tests/specs/bench/no_prompt_with_denied_perms/__test__.jsonc b/tests/specs/bench/no_prompt_with_denied_perms/__test__.jsonc new file mode 100644 index 000000000..a06645249 --- /dev/null +++ b/tests/specs/bench/no_prompt_with_denied_perms/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --quiet --allow-read no_prompt_with_denied_perms.ts", + "output": "no_prompt_with_denied_perms.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/no_prompt_with_denied_perms/no_prompt_with_denied_perms.out b/tests/specs/bench/no_prompt_with_denied_perms/no_prompt_with_denied_perms.out new file mode 100644 index 000000000..bbdd2ac46 --- /dev/null +++ b/tests/specs/bench/no_prompt_with_denied_perms/no_prompt_with_denied_perms.out @@ -0,0 +1,9 @@ +[WILDCARD]cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/no_prompt_with_denied_perms.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +no prompt error: PermissionDenied: Requires read access to "./some_file.txt", run again with the --allow-read flag +[WILDCARD] +error: Bench failed diff --git a/tests/specs/bench/no_prompt_with_denied_perms/no_prompt_with_denied_perms.ts b/tests/specs/bench/no_prompt_with_denied_perms/no_prompt_with_denied_perms.ts new file mode 100644 index 000000000..2f0d63bbe --- /dev/null +++ b/tests/specs/bench/no_prompt_with_denied_perms/no_prompt_with_denied_perms.ts @@ -0,0 +1,3 @@ +Deno.bench("no prompt", { permissions: { read: false } }, async () => { + await Deno.readTextFile("./some_file.txt"); +}); diff --git a/tests/specs/bench/no_run/__test__.jsonc b/tests/specs/bench/no_run/__test__.jsonc new file mode 100644 index 000000000..159f6fd5a --- /dev/null +++ b/tests/specs/bench/no_run/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --no-run no_run.ts", + "output": "no_run.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/no_run/no_run.out b/tests/specs/bench/no_run/no_run.out new file mode 100644 index 000000000..77ce18366 --- /dev/null +++ b/tests/specs/bench/no_run/no_run.out @@ -0,0 +1,5 @@ +Check [WILDCARD]/no_run.ts +error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. +const _value: string = 1; + ~~~~~~ + at [WILDCARD]/no_run.ts:1:7 diff --git a/tests/specs/bench/no_run/no_run.ts b/tests/specs/bench/no_run/no_run.ts new file mode 100644 index 000000000..c7a5dc1e8 --- /dev/null +++ b/tests/specs/bench/no_run/no_run.ts @@ -0,0 +1,2 @@ +const _value: string = 1; +console.log("this should not be run"); diff --git a/tests/specs/bench/only/__test__.jsonc b/tests/specs/bench/only/__test__.jsonc new file mode 100644 index 000000000..7d50a6dec --- /dev/null +++ b/tests/specs/bench/only/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench only.ts", + "output": "only.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/only/only.out b/tests/specs/bench/only/only.out new file mode 100644 index 000000000..e3332d174 --- /dev/null +++ b/tests/specs/bench/only/only.out @@ -0,0 +1,9 @@ +Check [WILDCARD]/only.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/only.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +only [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +error: Bench failed because the "only" option was used diff --git a/tests/specs/bench/only/only.ts b/tests/specs/bench/only/only.ts new file mode 100644 index 000000000..0129c024c --- /dev/null +++ b/tests/specs/bench/only/only.ts @@ -0,0 +1,15 @@ +Deno.bench({ + name: "before", + fn() {}, +}); + +Deno.bench({ + only: true, + name: "only", + fn() {}, +}); + +Deno.bench({ + name: "after", + fn() {}, +}); diff --git a/tests/specs/bench/overloads/__test__.jsonc b/tests/specs/bench/overloads/__test__.jsonc new file mode 100644 index 000000000..ae0fe0a07 --- /dev/null +++ b/tests/specs/bench/overloads/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench overloads.ts", + "output": "overloads.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/overloads/overloads.out b/tests/specs/bench/overloads/overloads.out new file mode 100644 index 000000000..21f8759dd --- /dev/null +++ b/tests/specs/bench/overloads/overloads.out @@ -0,0 +1,12 @@ +Check [WILDCARD]/overloads.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/overloads.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +bench0 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench1 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench2 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench4 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] diff --git a/tests/specs/bench/overloads/overloads.ts b/tests/specs/bench/overloads/overloads.ts new file mode 100644 index 000000000..4f5887f79 --- /dev/null +++ b/tests/specs/bench/overloads/overloads.ts @@ -0,0 +1,6 @@ +Deno.bench("bench0", () => {}); +Deno.bench(function bench1() {}); +Deno.bench({ name: "bench2", fn: () => {} }); +Deno.bench("bench3", { permissions: "none" }, () => {}); +Deno.bench({ name: "bench4" }, () => {}); +Deno.bench({ ignore: true }, function bench5() {}); diff --git a/tests/specs/bench/package_json/__test__.jsonc b/tests/specs/bench/package_json/__test__.jsonc new file mode 100644 index 000000000..001cc8b54 --- /dev/null +++ b/tests/specs/bench/package_json/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "bench", + "output": "lib.bench.out" +} diff --git a/tests/specs/bench/package_json/lib.bench.out b/tests/specs/bench/package_json/lib.bench.out new file mode 100644 index 000000000..fa9c5efc6 --- /dev/null +++ b/tests/specs/bench/package_json/lib.bench.out @@ -0,0 +1,11 @@ +Download http://localhost:4545/npm/registry/@denotest/esm-basic +Download http://localhost:4545/npm/registry/@denotest/esm-basic/1.0.0.tgz +Initialize @denotest/esm-basic@1.0.0 +Check file:///[WILDCARD]/lib.bench.ts +cpu: [WILDCARD] +runtime: [WILDCARD] + +file:///[WILDCARD]/lib.bench.ts +[WILDCARD] +---------------------------------------------------------------- ----------------------------- +should add [WILDCARD] diff --git a/tests/specs/bench/package_json/lib.bench.ts b/tests/specs/bench/package_json/lib.bench.ts new file mode 100644 index 000000000..e6b79d025 --- /dev/null +++ b/tests/specs/bench/package_json/lib.bench.ts @@ -0,0 +1,7 @@ +import { add } from "./lib.ts"; + +Deno.bench("should add", () => { + if (add(1, 2) !== 3) { + throw new Error("Fail"); + } +}); diff --git a/tests/specs/bench/package_json/lib.ts b/tests/specs/bench/package_json/lib.ts new file mode 100644 index 000000000..1deed81f7 --- /dev/null +++ b/tests/specs/bench/package_json/lib.ts @@ -0,0 +1,9 @@ +import * as test from "@denotest/esm-basic"; + +export function add(a: number, b: number) { + return a + b; +} + +export function getValue() { + return test.getValue(); +} diff --git a/tests/specs/bench/package_json/package.json b/tests/specs/bench/package_json/package.json new file mode 100644 index 000000000..54ca824d6 --- /dev/null +++ b/tests/specs/bench/package_json/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@denotest/esm-basic": "*" + } +} diff --git a/tests/specs/bench/pass/__test__.jsonc b/tests/specs/bench/pass/__test__.jsonc new file mode 100644 index 000000000..797684ec6 --- /dev/null +++ b/tests/specs/bench/pass/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench pass.ts", + "output": "pass.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/pass/pass.out b/tests/specs/bench/pass/pass.out new file mode 100644 index 000000000..4be2b8723 --- /dev/null +++ b/tests/specs/bench/pass/pass.out @@ -0,0 +1,17 @@ +Check [WILDCARD]/pass.ts +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/pass.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +--------------------------------------------------------------- ----------------------------- +bench0 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench1 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench2 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench3 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench4 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench5 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench6 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench7 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench8 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +bench9 [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] diff --git a/tests/specs/bench/pass/pass.ts b/tests/specs/bench/pass/pass.ts new file mode 100644 index 000000000..48348d447 --- /dev/null +++ b/tests/specs/bench/pass/pass.ts @@ -0,0 +1,10 @@ +Deno.bench("bench0", () => {}); +Deno.bench("bench1", () => {}); +Deno.bench("bench2", () => {}); +Deno.bench("bench3", () => {}); +Deno.bench("bench4", () => {}); +Deno.bench("bench5", () => {}); +Deno.bench("bench6", () => {}); +Deno.bench("bench7", () => {}); +Deno.bench("bench8", () => {}); +Deno.bench("bench9", () => {}); diff --git a/tests/specs/bench/quiet/__test__.jsonc b/tests/specs/bench/quiet/__test__.jsonc new file mode 100644 index 000000000..a220e9936 --- /dev/null +++ b/tests/specs/bench/quiet/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench --quiet quiet.ts", + "output": "quiet.out", + "exitCode": 0 +} diff --git a/tests/specs/bench/quiet/quiet.out b/tests/specs/bench/quiet/quiet.out new file mode 100644 index 000000000..fa9166d65 --- /dev/null +++ b/tests/specs/bench/quiet/quiet.out @@ -0,0 +1,10 @@ +cpu: [WILDCARD] +runtime: deno [WILDCARD] ([WILDCARD]) + +[WILDCARD]/quiet.ts +benchmark time (avg) iter/s (min … max) p75 p99 p995 +------------------------------------------------------------------- ----------------------------- +console.log [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +console.error [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +console.info [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] +console.warn [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] diff --git a/tests/specs/bench/quiet/quiet.ts b/tests/specs/bench/quiet/quiet.ts new file mode 100644 index 000000000..efeb366ff --- /dev/null +++ b/tests/specs/bench/quiet/quiet.ts @@ -0,0 +1,15 @@ +Deno.bench("console.log", function () { + console.log("log"); +}); + +Deno.bench("console.error", function () { + console.error("error"); +}); + +Deno.bench("console.info", function () { + console.info("info"); +}); + +Deno.bench("console.warn", function () { + console.info("warn"); +}); diff --git a/tests/specs/bench/unhandled_rejection/__test__.jsonc b/tests/specs/bench/unhandled_rejection/__test__.jsonc new file mode 100644 index 000000000..0576136ef --- /dev/null +++ b/tests/specs/bench/unhandled_rejection/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench unhandled_rejection.ts", + "output": "unhandled_rejection.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/unhandled_rejection/unhandled_rejection.out b/tests/specs/bench/unhandled_rejection/unhandled_rejection.out new file mode 100644 index 000000000..b95b9ab8b --- /dev/null +++ b/tests/specs/bench/unhandled_rejection/unhandled_rejection.out @@ -0,0 +1,11 @@ +Check [WILDCARD]/unhandled_rejection.ts +error: (in promise) Error: rejection + reject(new Error("rejection")); + ^ + at [WILDCARD]/unhandled_rejection.ts:2:10 + at new Promise () + at [WILDCARD]/unhandled_rejection.ts:1:1 +This error was not caught from a benchmark and caused the bench runner to fail on the referenced module. +It most likely originated from a dangling promise, event/timeout handler or top-level code. + +error: Bench failed diff --git a/tests/specs/bench/unhandled_rejection/unhandled_rejection.ts b/tests/specs/bench/unhandled_rejection/unhandled_rejection.ts new file mode 100644 index 000000000..32f3111ea --- /dev/null +++ b/tests/specs/bench/unhandled_rejection/unhandled_rejection.ts @@ -0,0 +1,3 @@ +new Promise((_resolve, reject) => { + reject(new Error("rejection")); +}); diff --git a/tests/specs/bench/unresolved_promise/__test__.jsonc b/tests/specs/bench/unresolved_promise/__test__.jsonc new file mode 100644 index 000000000..487e46b3d --- /dev/null +++ b/tests/specs/bench/unresolved_promise/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "bench unresolved_promise.ts", + "output": "unresolved_promise.out", + "exitCode": 1 +} diff --git a/tests/specs/bench/unresolved_promise/unresolved_promise.out b/tests/specs/bench/unresolved_promise/unresolved_promise.out new file mode 100644 index 000000000..92d29f399 --- /dev/null +++ b/tests/specs/bench/unresolved_promise/unresolved_promise.out @@ -0,0 +1,9 @@ +Check [WILDCARD]/unresolved_promise.ts +error: Top-level await promise never resolved +await new Promise((_resolve, _reject) => {}); +^ + at ([WILDCARD]/unresolved_promise.ts:1:1) +This error was not caught from a benchmark and caused the bench runner to fail on the referenced module. +It most likely originated from a dangling promise, event/timeout handler or top-level code. + +error: Bench failed diff --git a/tests/specs/bench/unresolved_promise/unresolved_promise.ts b/tests/specs/bench/unresolved_promise/unresolved_promise.ts new file mode 100644 index 000000000..25fe70762 --- /dev/null +++ b/tests/specs/bench/unresolved_promise/unresolved_promise.ts @@ -0,0 +1 @@ +await new Promise((_resolve, _reject) => {}); diff --git a/tests/specs/cache/check_local_by_default/__test__.jsonc b/tests/specs/cache/check_local_by_default/__test__.jsonc new file mode 100644 index 000000000..e6d0829fd --- /dev/null +++ b/tests/specs/cache/check_local_by_default/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "cache --quiet check_local_by_default.ts", + "output": "check_local_by_default.out" +} diff --git a/tests/specs/cache/check_local_by_default/check_local_by_default.out b/tests/specs/cache/check_local_by_default/check_local_by_default.out new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/cache/check_local_by_default/check_local_by_default.ts b/tests/specs/cache/check_local_by_default/check_local_by_default.ts new file mode 100644 index 000000000..2ae8c2692 --- /dev/null +++ b/tests/specs/cache/check_local_by_default/check_local_by_default.ts @@ -0,0 +1,3 @@ +import * as a from "http://localhost:4545/subdir/type_error.ts"; + +console.log(a.a); diff --git a/tests/specs/cache/check_local_by_default2/__test__.jsonc b/tests/specs/cache/check_local_by_default2/__test__.jsonc new file mode 100644 index 000000000..a9e70dcd9 --- /dev/null +++ b/tests/specs/cache/check_local_by_default2/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "cache --quiet check_local_by_default2.ts", + "output": "check_local_by_default2.out" +} diff --git a/tests/specs/cache/check_local_by_default2/check_local_by_default2.out b/tests/specs/cache/check_local_by_default2/check_local_by_default2.out new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/cache/check_local_by_default2/check_local_by_default2.ts b/tests/specs/cache/check_local_by_default2/check_local_by_default2.ts new file mode 100644 index 000000000..5177ff944 --- /dev/null +++ b/tests/specs/cache/check_local_by_default2/check_local_by_default2.ts @@ -0,0 +1,6 @@ +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/specs/cache/extensionless/__test__.jsonc b/tests/specs/cache/extensionless/__test__.jsonc new file mode 100644 index 000000000..837f26ecc --- /dev/null +++ b/tests/specs/cache/extensionless/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "cache --reload --check=all http://localhost:4545/subdir/no_js_ext", + "output": "cache_extensionless.out" +} diff --git a/tests/specs/cache/extensionless/cache_extensionless.out b/tests/specs/cache/extensionless/cache_extensionless.out new file mode 100644 index 000000000..3694c67cb --- /dev/null +++ b/tests/specs/cache/extensionless/cache_extensionless.out @@ -0,0 +1,2 @@ +[WILDCARD] +Check http://localhost:4545/subdir/no_js_ext diff --git a/tests/specs/cache/fetch_multiple/__test__.jsonc b/tests/specs/cache/fetch_multiple/__test__.jsonc new file mode 100644 index 000000000..a5cf41113 --- /dev/null +++ b/tests/specs/cache/fetch_multiple/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "cache --reload --check=all test.ts other.ts", + "output": "fetch_multiple.out" +} diff --git a/tests/specs/cache/fetch_multiple/fetch_multiple.out b/tests/specs/cache/fetch_multiple/fetch_multiple.out new file mode 100644 index 000000000..1cd3639ec --- /dev/null +++ b/tests/specs/cache/fetch_multiple/fetch_multiple.out @@ -0,0 +1,5 @@ +Download http://localhost:4545/subdir/mod2.ts +Download http://localhost:4545/subdir/mt_text_typescript.t1.ts +Download http://localhost:4545/subdir/print_hello.ts +Check [WILDCARD]/fetch_multiple/test.ts +Check [WILDCARD]/fetch_multiple/other.ts diff --git a/tests/specs/cache/fetch_multiple/other.ts b/tests/specs/cache/fetch_multiple/other.ts new file mode 100644 index 000000000..91fe376b3 --- /dev/null +++ b/tests/specs/cache/fetch_multiple/other.ts @@ -0,0 +1 @@ +import "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; diff --git a/tests/specs/cache/fetch_multiple/test.ts b/tests/specs/cache/fetch_multiple/test.ts new file mode 100644 index 000000000..baa52775d --- /dev/null +++ b/tests/specs/cache/fetch_multiple/test.ts @@ -0,0 +1 @@ +import "http://localhost:4545/subdir/mod2.ts"; diff --git a/tests/specs/cache/ignore_require/__test__.jsonc b/tests/specs/cache/ignore_require/__test__.jsonc new file mode 100644 index 000000000..e6d0093c7 --- /dev/null +++ b/tests/specs/cache/ignore_require/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "cache --reload --no-check ignore_require.js", + "output": "" +} diff --git a/tests/specs/cache/ignore_require/ignore_require.js b/tests/specs/cache/ignore_require/ignore_require.js new file mode 100644 index 000000000..a8ef15021 --- /dev/null +++ b/tests/specs/cache/ignore_require/ignore_require.js @@ -0,0 +1,2 @@ +// deno-lint-ignore-file +require("invalid module specifier"); diff --git a/tests/specs/cache/json_import/__test__.jsonc b/tests/specs/cache/json_import/__test__.jsonc new file mode 100644 index 000000000..fdc3459c3 --- /dev/null +++ b/tests/specs/cache/json_import/__test__.jsonc @@ -0,0 +1,5 @@ +{ + // should not error + "args": "cache --quiet main.ts", + "output": "[WILDCARD]" +} diff --git a/tests/specs/cache/json_import/main.ts b/tests/specs/cache/json_import/main.ts new file mode 100644 index 000000000..78273558f --- /dev/null +++ b/tests/specs/cache/json_import/main.ts @@ -0,0 +1,2 @@ +import asdf from "./test.json" assert { type: "json" }; +console.log(asdf); diff --git a/tests/specs/cache/json_import/test.json b/tests/specs/cache/json_import/test.json new file mode 100644 index 000000000..258849a68 --- /dev/null +++ b/tests/specs/cache/json_import/test.json @@ -0,0 +1,5 @@ +{ + "foo": { + "bar": 1 + } +} diff --git a/tests/specs/cache/package_json/__test__.jsonc b/tests/specs/cache/package_json/__test__.jsonc new file mode 100644 index 000000000..b25ac147d --- /dev/null +++ b/tests/specs/cache/package_json/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "cache main.ts", + "output": "main.cache.out" +} diff --git a/tests/specs/cache/package_json/lib.ts b/tests/specs/cache/package_json/lib.ts new file mode 100644 index 000000000..1deed81f7 --- /dev/null +++ b/tests/specs/cache/package_json/lib.ts @@ -0,0 +1,9 @@ +import * as test from "@denotest/esm-basic"; + +export function add(a: number, b: number) { + return a + b; +} + +export function getValue() { + return test.getValue(); +} diff --git a/tests/specs/cache/package_json/main.cache.out b/tests/specs/cache/package_json/main.cache.out new file mode 100644 index 000000000..1c729e2a3 --- /dev/null +++ b/tests/specs/cache/package_json/main.cache.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/npm/registry/@denotest/esm-basic +Download http://localhost:4545/npm/registry/@denotest/esm-basic/1.0.0.tgz +Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/cache/package_json/main.ts b/tests/specs/cache/package_json/main.ts new file mode 100644 index 000000000..e241f3002 --- /dev/null +++ b/tests/specs/cache/package_json/main.ts @@ -0,0 +1,3 @@ +import { getValue } from "./lib.ts"; + +console.log(getValue()); diff --git a/tests/specs/cache/package_json/package.json b/tests/specs/cache/package_json/package.json new file mode 100644 index 000000000..54ca824d6 --- /dev/null +++ b/tests/specs/cache/package_json/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@denotest/esm-basic": "*" + } +} diff --git a/tests/specs/cache/performance_stats/__test__.jsonc b/tests/specs/cache/performance_stats/__test__.jsonc new file mode 100644 index 000000000..f4d37b803 --- /dev/null +++ b/tests/specs/cache/performance_stats/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "cache --reload --check=all --log-level debug hello.ts", + "output": "performance_stats.out" +} diff --git a/tests/specs/cache/performance_stats/hello.ts b/tests/specs/cache/performance_stats/hello.ts new file mode 100644 index 000000000..accefceba --- /dev/null +++ b/tests/specs/cache/performance_stats/hello.ts @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/specs/cache/performance_stats/performance_stats.out b/tests/specs/cache/performance_stats/performance_stats.out new file mode 100644 index 000000000..141829ee6 --- /dev/null +++ b/tests/specs/cache/performance_stats/performance_stats.out @@ -0,0 +1,16 @@ +[WILDCARD] +DEBUG RS - [WILDCARD] - Compilation statistics: + Files: [WILDCARD] + Nodes: [WILDCARD] + Identifiers: [WILDCARD] + Symbols: [WILDCARD] + Types: [WILDCARD] + Instantiations: [WILDCARD] + Parse time: [WILDCARD] + Bind time: [WILDCARD] + Check time: [WILDCARD] + Emit time: [WILDCARD] + Total TS time: [WILDCARD] + Compile time: [WILDCARD] + +[WILDCARD] diff --git a/tests/specs/cache/random_extension/__test__.jsonc b/tests/specs/cache/random_extension/__test__.jsonc new file mode 100644 index 000000000..7b847a77d --- /dev/null +++ b/tests/specs/cache/random_extension/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "cache --reload --check=all http://localhost:4545/subdir/no_js_ext@1.0.0", + "output": "cache_random_extension.out" +} diff --git a/tests/specs/cache/random_extension/cache_random_extension.out b/tests/specs/cache/random_extension/cache_random_extension.out new file mode 100644 index 000000000..745a2e0e3 --- /dev/null +++ b/tests/specs/cache/random_extension/cache_random_extension.out @@ -0,0 +1,2 @@ +[WILDCARD] +Check http://localhost:4545/subdir/no_js_ext@1.0.0 diff --git a/tests/specs/cache/redirect/__test__.jsonc b/tests/specs/cache/redirect/__test__.jsonc new file mode 100644 index 000000000..251bc6174 --- /dev/null +++ b/tests/specs/cache/redirect/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "cache --reload --check=all http://localhost:4548/subdir/redirects/a.ts", + "output": "redirect_cache.out" +} diff --git a/tests/specs/cache/redirect/redirect_cache.out b/tests/specs/cache/redirect/redirect_cache.out new file mode 100644 index 000000000..8905c4529 --- /dev/null +++ b/tests/specs/cache/redirect/redirect_cache.out @@ -0,0 +1,5 @@ +Download http://localhost:4548/subdir/redirects/a.ts +Download http://localhost:4546/subdir/redirects/a.ts +Download http://localhost:4545/subdir/redirects/a.ts +Download http://localhost:4545/subdir/redirects/b.ts +Check http://localhost:4548/subdir/redirects/a.ts diff --git a/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts new file mode 100644 index 000000000..c0748305d --- /dev/null +++ b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts @@ -0,0 +1 @@ +import "foo"; diff --git a/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out new file mode 100644 index 000000000..2668a6e08 --- /dev/null +++ b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Relative import path "foo" not prefixed with / or ./ or ../ + at file:///[WILDCARD]/095_cache_with_bare_import.ts:[WILDCARD] diff --git a/tests/specs/cache/with_bare_import/__test__.jsonc b/tests/specs/cache/with_bare_import/__test__.jsonc new file mode 100644 index 000000000..0ff2d09cb --- /dev/null +++ b/tests/specs/cache/with_bare_import/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "cache 095_cache_with_bare_import.ts", + "output": "095_cache_with_bare_import.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/check/check_types_dts/__test__.jsonc b/tests/specs/check/check_types_dts/__test__.jsonc new file mode 100644 index 000000000..7f620daa2 --- /dev/null +++ b/tests/specs/check/check_types_dts/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check main.ts", + "output": "main.out", + "exitCode": 0 +} diff --git a/tests/specs/check/check_types_dts/deno.json b/tests/specs/check/check_types_dts/deno.json new file mode 100644 index 000000000..85f1549e0 --- /dev/null +++ b/tests/specs/check/check_types_dts/deno.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": [ + "./types.d.ts" + ] + } +} diff --git a/tests/specs/check/check_types_dts/main.out b/tests/specs/check/check_types_dts/main.out new file mode 100644 index 000000000..b8fb00c4f --- /dev/null +++ b/tests/specs/check/check_types_dts/main.out @@ -0,0 +1 @@ +Check file:///[WILDCARD]/main.ts diff --git a/tests/specs/check/check_types_dts/main.ts b/tests/specs/check/check_types_dts/main.ts new file mode 100644 index 000000000..ca375a094 --- /dev/null +++ b/tests/specs/check/check_types_dts/main.ts @@ -0,0 +1,3 @@ +console.log("Hello world!"); + +test.test(); diff --git a/tests/specs/check/check_types_dts/types.d.ts b/tests/specs/check/check_types_dts/types.d.ts new file mode 100644 index 000000000..141c2a3d3 --- /dev/null +++ b/tests/specs/check/check_types_dts/types.d.ts @@ -0,0 +1,3 @@ +declare class test { + static test(): void; +} diff --git a/tests/specs/check/check_with_excluded_file_specified/__test__.jsonc b/tests/specs/check/check_with_excluded_file_specified/__test__.jsonc new file mode 100644 index 000000000..212ab8fb3 --- /dev/null +++ b/tests/specs/check/check_with_excluded_file_specified/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check lib/types.d.ts", + "output": "check.out" +} diff --git a/tests/specs/check/check_with_excluded_file_specified/check.out b/tests/specs/check/check_with_excluded_file_specified/check.out new file mode 100644 index 000000000..2bc26aaaf --- /dev/null +++ b/tests/specs/check/check_with_excluded_file_specified/check.out @@ -0,0 +1 @@ +Warning No matching files found. diff --git a/tests/specs/check/check_with_excluded_file_specified/deno.json b/tests/specs/check/check_with_excluded_file_specified/deno.json new file mode 100644 index 000000000..039be18df --- /dev/null +++ b/tests/specs/check/check_with_excluded_file_specified/deno.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "types": ["./lib/types.d.ts"] + }, + "exclude": ["lib"] +} diff --git a/tests/specs/check/check_with_excluded_file_specified/lib/types.d.ts b/tests/specs/check/check_with_excluded_file_specified/lib/types.d.ts new file mode 100644 index 000000000..a02ad0cbe --- /dev/null +++ b/tests/specs/check/check_with_excluded_file_specified/lib/types.d.ts @@ -0,0 +1,2 @@ +// deno-lint-ignore-file +declare var test: number; diff --git a/tests/specs/check/extensionless/__test__.jsonc b/tests/specs/check/extensionless/__test__.jsonc new file mode 100644 index 000000000..670680b7d --- /dev/null +++ b/tests/specs/check/extensionless/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check --reload --all http://localhost:4545/subdir/no_js_ext", + "output": "check.out" +} diff --git a/tests/specs/check/extensionless/check.out b/tests/specs/check/extensionless/check.out new file mode 100644 index 000000000..3694c67cb --- /dev/null +++ b/tests/specs/check/extensionless/check.out @@ -0,0 +1,2 @@ +[WILDCARD] +Check http://localhost:4545/subdir/no_js_ext diff --git a/tests/specs/check/random_extension/__test__.jsonc b/tests/specs/check/random_extension/__test__.jsonc new file mode 100644 index 000000000..f504c1d2b --- /dev/null +++ b/tests/specs/check/random_extension/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check --reload --all http://localhost:4545/subdir/no_js_ext@1.0.0", + "output": "output.out" +} diff --git a/tests/specs/check/random_extension/output.out b/tests/specs/check/random_extension/output.out new file mode 100644 index 000000000..745a2e0e3 --- /dev/null +++ b/tests/specs/check/random_extension/output.out @@ -0,0 +1,2 @@ +[WILDCARD] +Check http://localhost:4545/subdir/no_js_ext@1.0.0 diff --git a/tests/specs/check/with_bare_import/095_cache_with_bare_import.ts b/tests/specs/check/with_bare_import/095_cache_with_bare_import.ts new file mode 100644 index 000000000..c0748305d --- /dev/null +++ b/tests/specs/check/with_bare_import/095_cache_with_bare_import.ts @@ -0,0 +1 @@ +import "foo"; diff --git a/tests/specs/check/with_bare_import/095_cache_with_bare_import.ts.out b/tests/specs/check/with_bare_import/095_cache_with_bare_import.ts.out new file mode 100644 index 000000000..2668a6e08 --- /dev/null +++ b/tests/specs/check/with_bare_import/095_cache_with_bare_import.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Relative import path "foo" not prefixed with / or ./ or ../ + at file:///[WILDCARD]/095_cache_with_bare_import.ts:[WILDCARD] diff --git a/tests/specs/check/with_bare_import/__test__.jsonc b/tests/specs/check/with_bare_import/__test__.jsonc new file mode 100644 index 000000000..c32a66ad2 --- /dev/null +++ b/tests/specs/check/with_bare_import/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check 095_cache_with_bare_import.ts", + "output": "095_cache_with_bare_import.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/lint/no_slow_types/__test__.jsonc b/tests/specs/lint/no_slow_types/__test__.jsonc new file mode 100644 index 000000000..2a5a34032 --- /dev/null +++ b/tests/specs/lint/no_slow_types/__test__.jsonc @@ -0,0 +1,17 @@ +{ + "steps": [{ + "args": "lint", + "output": "no_slow_types.out", + "exitCode": 1 + }, { + "args": "lint --rules-exclude=no-slow-types", + "output": "Checked 4 files\n" + }, { + "args": "lint --config=deno.non-package.json", + "output": "Checked 4 files\n" + }, { + // non-entrypoint + "args": "lint d.ts", + "output": "Checked 1 file\n" + }] +} diff --git a/tests/specs/lint/no_slow_types/a.ts b/tests/specs/lint/no_slow_types/a.ts new file mode 100644 index 000000000..3b399665d --- /dev/null +++ b/tests/specs/lint/no_slow_types/a.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types/b.ts b/tests/specs/lint/no_slow_types/b.ts new file mode 100644 index 000000000..b96a79489 --- /dev/null +++ b/tests/specs/lint/no_slow_types/b.ts @@ -0,0 +1,5 @@ +export function addB(a: number, b: number) { + return a + b; +} + +export * from "./d.ts"; diff --git a/tests/specs/lint/no_slow_types/c.ts b/tests/specs/lint/no_slow_types/c.ts new file mode 100644 index 000000000..517aa3d21 --- /dev/null +++ b/tests/specs/lint/no_slow_types/c.ts @@ -0,0 +1,4 @@ +// this one won't error because it's not an export +export function addC(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types/d.ts b/tests/specs/lint/no_slow_types/d.ts new file mode 100644 index 000000000..babe9d81b --- /dev/null +++ b/tests/specs/lint/no_slow_types/d.ts @@ -0,0 +1,4 @@ +// this one is re-exported via b.ts +export function addD(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types/deno.json b/tests/specs/lint/no_slow_types/deno.json new file mode 100644 index 000000000..2fd0af5f0 --- /dev/null +++ b/tests/specs/lint/no_slow_types/deno.json @@ -0,0 +1,8 @@ +{ + "name": "@pkg/pkg", + "version": "1.0.0", + "exports": { + "./a": "./a.ts", + "./b": "./b.ts" + } +} diff --git a/tests/specs/lint/no_slow_types/deno.non-package.json b/tests/specs/lint/no_slow_types/deno.non-package.json new file mode 100644 index 000000000..2c63c0851 --- /dev/null +++ b/tests/specs/lint/no_slow_types/deno.non-package.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/lint/no_slow_types/no_slow_types.out b/tests/specs/lint/no_slow_types/no_slow_types.out new file mode 100644 index 000000000..5828906e7 --- /dev/null +++ b/tests/specs/lint/no_slow_types/no_slow_types.out @@ -0,0 +1,35 @@ +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]a.ts:1:17 + | +1 | export function add(a: number, b: number) { + | ^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]b.ts:1:17 + | +1 | export function addB(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]d.ts:2:17 + | +2 | export function addD(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +Found 3 problems +Checked 4 files diff --git a/tests/specs/lint/no_slow_types/no_slow_types_entrypoint.out b/tests/specs/lint/no_slow_types/no_slow_types_entrypoint.out new file mode 100644 index 000000000..b8c1013bf --- /dev/null +++ b/tests/specs/lint/no_slow_types/no_slow_types_entrypoint.out @@ -0,0 +1,35 @@ +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]a.ts:1:17 + | +1 | export function add(a: number, b: number) { + | ^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]b.ts:1:17 + | +1 | export function addB(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]d.ts:2:17 + | +2 | export function addD(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +Found 3 problems +Checked 1 file diff --git a/tests/specs/lint/no_slow_types_entrypoint/__test__.jsonc b/tests/specs/lint/no_slow_types_entrypoint/__test__.jsonc new file mode 100644 index 000000000..2ba74c03f --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "lint a.ts", + "output": "no_slow_types_entrypoint.out", + "exitCode": 1 +} diff --git a/tests/specs/lint/no_slow_types_entrypoint/a.ts b/tests/specs/lint/no_slow_types_entrypoint/a.ts new file mode 100644 index 000000000..3b399665d --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/a.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types_entrypoint/b.ts b/tests/specs/lint/no_slow_types_entrypoint/b.ts new file mode 100644 index 000000000..b96a79489 --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/b.ts @@ -0,0 +1,5 @@ +export function addB(a: number, b: number) { + return a + b; +} + +export * from "./d.ts"; diff --git a/tests/specs/lint/no_slow_types_entrypoint/c.ts b/tests/specs/lint/no_slow_types_entrypoint/c.ts new file mode 100644 index 000000000..517aa3d21 --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/c.ts @@ -0,0 +1,4 @@ +// this one won't error because it's not an export +export function addC(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types_entrypoint/d.ts b/tests/specs/lint/no_slow_types_entrypoint/d.ts new file mode 100644 index 000000000..babe9d81b --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/d.ts @@ -0,0 +1,4 @@ +// this one is re-exported via b.ts +export function addD(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types_entrypoint/deno.json b/tests/specs/lint/no_slow_types_entrypoint/deno.json new file mode 100644 index 000000000..2fd0af5f0 --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/deno.json @@ -0,0 +1,8 @@ +{ + "name": "@pkg/pkg", + "version": "1.0.0", + "exports": { + "./a": "./a.ts", + "./b": "./b.ts" + } +} diff --git a/tests/specs/lint/no_slow_types_entrypoint/deno.non-package.json b/tests/specs/lint/no_slow_types_entrypoint/deno.non-package.json new file mode 100644 index 000000000..2c63c0851 --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/deno.non-package.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/lint/no_slow_types_entrypoint/no_slow_types.out b/tests/specs/lint/no_slow_types_entrypoint/no_slow_types.out new file mode 100644 index 000000000..5828906e7 --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/no_slow_types.out @@ -0,0 +1,35 @@ +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]a.ts:1:17 + | +1 | export function add(a: number, b: number) { + | ^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]b.ts:1:17 + | +1 | export function addB(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]d.ts:2:17 + | +2 | export function addD(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +Found 3 problems +Checked 4 files diff --git a/tests/specs/lint/no_slow_types_entrypoint/no_slow_types_entrypoint.out b/tests/specs/lint/no_slow_types_entrypoint/no_slow_types_entrypoint.out new file mode 100644 index 000000000..b8c1013bf --- /dev/null +++ b/tests/specs/lint/no_slow_types_entrypoint/no_slow_types_entrypoint.out @@ -0,0 +1,35 @@ +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]a.ts:1:17 + | +1 | export function add(a: number, b: number) { + | ^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]b.ts:1:17 + | +1 | export function addB(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]d.ts:2:17 + | +2 | export function addD(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +Found 3 problems +Checked 1 file diff --git a/tests/specs/lint/no_slow_types_workspace/__test__.jsonc b/tests/specs/lint/no_slow_types_workspace/__test__.jsonc new file mode 100644 index 000000000..7128e116c --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "lint", + "output": "output.out", + "exitCode": 1 +} diff --git a/tests/specs/lint/no_slow_types_workspace/a/b.ts b/tests/specs/lint/no_slow_types_workspace/a/b.ts new file mode 100644 index 000000000..b96a79489 --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/a/b.ts @@ -0,0 +1,5 @@ +export function addB(a: number, b: number) { + return a + b; +} + +export * from "./d.ts"; diff --git a/tests/specs/lint/no_slow_types_workspace/a/d.ts b/tests/specs/lint/no_slow_types_workspace/a/d.ts new file mode 100644 index 000000000..babe9d81b --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/a/d.ts @@ -0,0 +1,4 @@ +// this one is re-exported via b.ts +export function addD(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types_workspace/a/deno.json b/tests/specs/lint/no_slow_types_workspace/a/deno.json new file mode 100644 index 000000000..5a971cd85 --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/a/deno.json @@ -0,0 +1,8 @@ +{ + "name": "@pkg/a", + "version": "1.0.0", + "exports": { + "./a": "./mod.ts", + "./b": "./b.ts" + } +} diff --git a/tests/specs/lint/no_slow_types_workspace/a/mod.ts b/tests/specs/lint/no_slow_types_workspace/a/mod.ts new file mode 100644 index 000000000..3b399665d --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/a/mod.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types_workspace/b/deno.json b/tests/specs/lint/no_slow_types_workspace/b/deno.json new file mode 100644 index 000000000..c95aeb029 --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/b/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@pkg/b", + "version": "1.0.0", + "exports": "./mod.ts" +} diff --git a/tests/specs/lint/no_slow_types_workspace/b/mod.ts b/tests/specs/lint/no_slow_types_workspace/b/mod.ts new file mode 100644 index 000000000..fa1c068de --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/b/mod.ts @@ -0,0 +1,4 @@ +// ok +export function addB(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types_workspace/c/deno.json b/tests/specs/lint/no_slow_types_workspace/c/deno.json new file mode 100644 index 000000000..36d6e2e67 --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/c/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@pkg/c", + "version": "1.0.0", + "exports": "./mod_c.ts" +} diff --git a/tests/specs/lint/no_slow_types_workspace/c/mod_c.ts b/tests/specs/lint/no_slow_types_workspace/c/mod_c.ts new file mode 100644 index 000000000..632a90b65 --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/c/mod_c.ts @@ -0,0 +1,4 @@ +// not ok +export function addC(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/lint/no_slow_types_workspace/deno.json b/tests/specs/lint/no_slow_types_workspace/deno.json new file mode 100644 index 000000000..e3dd981e5 --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/deno.json @@ -0,0 +1,7 @@ +{ + "workspaces": [ + "./a", + "./b", + "./c" + ] +} diff --git a/tests/specs/lint/no_slow_types_workspace/output.out b/tests/specs/lint/no_slow_types_workspace/output.out new file mode 100644 index 000000000..05f54099b --- /dev/null +++ b/tests/specs/lint/no_slow_types_workspace/output.out @@ -0,0 +1,46 @@ +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]b.ts:1:17 + | +1 | export function addB(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]d.ts:2:17 + | +2 | export function addD(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]mod.ts:1:17 + | +1 | export function add(a: number, b: number) { + | ^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +error[no-slow-types]: missing explicit return type in the public API + --> [WILDCARD]mod_c.ts:2:17 + | +2 | export function addC(a: number, b: number) { + | ^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + + +Found 4 problems +Checked 5 files diff --git a/tests/specs/lockfile/no_lock/__test__.jsonc b/tests/specs/lockfile/no_lock/__test__.jsonc new file mode 100644 index 000000000..60bbd17e0 --- /dev/null +++ b/tests/specs/lockfile/no_lock/__test__.jsonc @@ -0,0 +1,31 @@ +{ + "steps": [{ + "args": "info main.ts", + "output": "fail_initial.out", + "exitCode": 10 + }, { + "args": "info --no-lock main.ts", + "output": "info.nolock.out" + }, { + "args": "bench", + "output": "fail.out", + "exitCode": 10 + }, { + "args": "bench --no-lock", + "output": "bench.nolock.out" + }, { + "args": "doc main.ts", + "exitCode": 10, + "output": "fail.out" + }, { + "args": "doc --no-lock main.ts", + "output": "doc.nolock.out" + }, { + "args": "test", + "exitCode": 10, + "output": "fail.out" + }, { + "args": "test --no-lock", + "output": "test.nolock.out" + }] +} diff --git a/tests/specs/lockfile/no_lock/bench.nolock.out b/tests/specs/lockfile/no_lock/bench.nolock.out new file mode 100644 index 000000000..351efc970 --- /dev/null +++ b/tests/specs/lockfile/no_lock/bench.nolock.out @@ -0,0 +1,5 @@ +Check file:///[WILDCARD]/main.bench.ts +cpu: [WILDCARD] +runtime: [WILDCARD] + +[WILDCARD] diff --git a/tests/specs/lockfile/no_lock/deno.json b/tests/specs/lockfile/no_lock/deno.json new file mode 100644 index 000000000..d6541b78e --- /dev/null +++ b/tests/specs/lockfile/no_lock/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "mod": "http://localhost:4545/lockfile/basic/mod.ts" + } +} diff --git a/tests/specs/lockfile/no_lock/deno.lock b/tests/specs/lockfile/no_lock/deno.lock new file mode 100644 index 000000000..42ab94f9b --- /dev/null +++ b/tests/specs/lockfile/no_lock/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/lockfile/basic/mod.ts": "invalid" + } +} diff --git a/tests/specs/lockfile/no_lock/doc.nolock.out b/tests/specs/lockfile/no_lock/doc.nolock.out new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/lockfile/no_lock/fail.out b/tests/specs/lockfile/no_lock/fail.out new file mode 100644 index 000000000..4c2b04423 --- /dev/null +++ b/tests/specs/lockfile/no_lock/fail.out @@ -0,0 +1,3 @@ +error: The source code is invalid, as it does not match the expected hash in the lock file. + Specifier: [WILDCARD]mod.ts + Lock file: [WILDCARD]deno.lock diff --git a/tests/specs/lockfile/no_lock/fail_initial.out b/tests/specs/lockfile/no_lock/fail_initial.out new file mode 100644 index 000000000..6a808c0a5 --- /dev/null +++ b/tests/specs/lockfile/no_lock/fail_initial.out @@ -0,0 +1,4 @@ +Download http://localhost:4545/lockfile/basic/mod.ts +error: The source code is invalid, as it does not match the expected hash in the lock file. + Specifier: [WILDCARD]mod.ts + Lock file: [WILDCARD]deno.lock diff --git a/tests/specs/lockfile/no_lock/info.nolock.out b/tests/specs/lockfile/no_lock/info.nolock.out new file mode 100644 index 000000000..b03661193 --- /dev/null +++ b/tests/specs/lockfile/no_lock/info.nolock.out @@ -0,0 +1,7 @@ +local: [WILDLINE]main.ts +type: TypeScript +dependencies: 1 unique +size: [WILDCARD] + +file:///[WILDCARD]/main.ts ([WILDLINE]) +└── http://localhost:4545/lockfile/basic/mod.ts ([WILDLINE]) diff --git a/tests/specs/lockfile/no_lock/main.bench.ts b/tests/specs/lockfile/no_lock/main.bench.ts new file mode 100644 index 000000000..918adde2f --- /dev/null +++ b/tests/specs/lockfile/no_lock/main.bench.ts @@ -0,0 +1,8 @@ +import { getValue } from "mod"; + +Deno.bench("bench", () => { + const testing = 1 + getValue(); + if (testing !== 6) { + throw "FAIL"; + } +}); diff --git a/tests/specs/lockfile/no_lock/main.test.ts b/tests/specs/lockfile/no_lock/main.test.ts new file mode 100644 index 000000000..fe45c799d --- /dev/null +++ b/tests/specs/lockfile/no_lock/main.test.ts @@ -0,0 +1,8 @@ +import { getValue } from "mod"; + +Deno.test("test", () => { + const testing = 1 + getValue(); + if (testing !== 6) { + throw "FAIL"; + } +}); diff --git a/tests/specs/lockfile/no_lock/main.ts b/tests/specs/lockfile/no_lock/main.ts new file mode 100644 index 000000000..8d07c8153 --- /dev/null +++ b/tests/specs/lockfile/no_lock/main.ts @@ -0,0 +1,3 @@ +import { getValue } from "mod"; + +console.log(getValue()); diff --git a/tests/specs/lockfile/no_lock/test.nolock.out b/tests/specs/lockfile/no_lock/test.nolock.out new file mode 100644 index 000000000..b5039c2d6 --- /dev/null +++ b/tests/specs/lockfile/no_lock/test.nolock.out @@ -0,0 +1,3 @@ +Check file:///[WILDCARD]/main.test.ts +running 1 test from [WILDCARD]/main.test.ts +[WILDCARD] diff --git a/tests/specs/mod.rs b/tests/specs/mod.rs index 16a9e6f05..fc61fefac 100644 --- a/tests/specs/mod.rs +++ b/tests/specs/mod.rs @@ -71,6 +71,9 @@ struct StepMetaData { /// Whether to clean the deno_dir before running the step. #[serde(default)] pub clean_deno_dir: bool, + /// If the test should be retried multiple times on failure. + #[serde(default)] + pub flaky: bool, pub args: VecOrString, pub cwd: Option, #[serde(rename = "if")] @@ -173,33 +176,12 @@ fn run_test(test: &CollectedTest, diagnostic_logger: Rc>>) { } for step in metadata.steps.iter().filter(|s| should_run_step(s)) { - if step.clean_deno_dir { - context.deno_dir().path().remove_dir_all(); - } - - let command = context - .new_command() - .envs(metadata.envs.iter().chain(step.envs.iter())); - let command = match &step.args { - VecOrString::Vec(args) => command.args_vec(args), - VecOrString::String(text) => command.args(text), - }; - let command = match &step.cwd { - Some(cwd) => command.current_dir(cwd), - None => command, - }; - let command = match &step.command_name { - Some(command_name) => command.name(command_name), - None => command, - }; - let output = command.run(); - if step.output.ends_with(".out") { - let test_output_path = cwd.join(&step.output); - output.assert_matches_file(test_output_path); + let run_func = || run_step(step, &metadata, &cwd, &context); + if step.flaky { + run_flaky(run_func); } else { - output.assert_matches_text(&step.output); + run_func(); } - output.assert_exit_code(step.exit_code); } } @@ -217,6 +199,53 @@ fn should_run_step(step: &StepMetaData) -> bool { } } +fn run_flaky(action: impl Fn()) { + for _ in 0..2 { + let result = std::panic::catch_unwind(AssertUnwindSafe(&action)); + if result.is_ok() { + return; + } + } + + // surface error on third try + action(); +} + +fn run_step( + step: &StepMetaData, + metadata: &MultiTestMetaData, + cwd: &PathRef, + context: &test_util::TestContext, +) { + if step.clean_deno_dir { + context.deno_dir().path().remove_dir_all(); + } + + let command = context + .new_command() + .envs(metadata.envs.iter().chain(step.envs.iter())); + let command = match &step.args { + VecOrString::Vec(args) => command.args_vec(args), + VecOrString::String(text) => command.args(text), + }; + let command = match &step.cwd { + Some(cwd) => command.current_dir(cwd), + None => command, + }; + let command = match &step.command_name { + Some(command_name) => command.name(command_name), + None => command, + }; + let output = command.run(); + if step.output.ends_with(".out") { + let test_output_path = cwd.join(&step.output); + output.assert_matches_file(test_output_path); + } else { + output.assert_matches_text(&step.output); + } + output.assert_exit_code(step.exit_code); +} + fn resolve_test_and_assertion_files( dir: &PathRef, metadata: &MultiTestMetaData, diff --git a/tests/specs/publish/allow_slow_types/__test__.jsonc b/tests/specs/publish/allow_slow_types/__test__.jsonc new file mode 100644 index 000000000..e9f1cd011 --- /dev/null +++ b/tests/specs/publish/allow_slow_types/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --allow-slow-types --token 'sadfasdf'", + "output": "allow_slow_types.out", + "exitCode": 0 +} diff --git a/tests/specs/publish/allow_slow_types/allow_slow_types.out b/tests/specs/publish/allow_slow_types/allow_slow_types.out new file mode 100644 index 000000000..cd22c0ce7 --- /dev/null +++ b/tests/specs/publish/allow_slow_types/allow_slow_types.out @@ -0,0 +1,5 @@ +Check file:///[WILDCARD]mod.ts +Warning Publishing a library with slow types is not recommended. This may lead to poor type checking performance for users of your package, may affect the quality of automatic documentation generation, and your package will not be shipped with a .d.ts file for Node.js users. +Publishing @foo/bar@1.1.0 ... +Successfully published @foo/bar@1.1.0 +Visit http://127.0.0.1:4250/@foo/bar@1.1.0 for details diff --git a/tests/specs/publish/allow_slow_types/deno.json b/tests/specs/publish/allow_slow_types/deno.json new file mode 100644 index 000000000..5826e5529 --- /dev/null +++ b/tests/specs/publish/allow_slow_types/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.1.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/allow_slow_types/mod.ts b/tests/specs/publish/allow_slow_types/mod.ts new file mode 100644 index 000000000..025311049 --- /dev/null +++ b/tests/specs/publish/allow_slow_types/mod.ts @@ -0,0 +1,4 @@ +// requires an explicit type annotation of `number` +export function getRandom() { + return Math.random(); +} diff --git a/tests/specs/publish/bare_node_builtins/__test__.jsonc b/tests/specs/publish/bare_node_builtins/__test__.jsonc new file mode 100644 index 000000000..f9e38fbe5 --- /dev/null +++ b/tests/specs/publish/bare_node_builtins/__test__.jsonc @@ -0,0 +1,17 @@ +{ + "tempDir": true, + "envs": { + "DISABLE_JSR_PROVENANCE": "true", + "DENO_TESTING_DISABLE_GIT_CHECK": "1" + }, + "steps": [{ + "args": "publish --token 'sadfasdf' --dry-run --unstable-bare-node-builtins", + "output": "bare_node_builtins.out" + }, { + "envs": { + "DENO_DISABLE_PEDANTIC_NODE_WARNINGS": "1" + }, + "args": "publish --token 'sadfasdf' --dry-run --unstable-bare-node-builtins", + "output": "no_warnings.out" + }] +} diff --git a/tests/specs/publish/bare_node_builtins/bare_node_builtins.out b/tests/specs/publish/bare_node_builtins/bare_node_builtins.out new file mode 100644 index 000000000..09acc639f --- /dev/null +++ b/tests/specs/publish/bare_node_builtins/bare_node_builtins.out @@ -0,0 +1,11 @@ +Warning: Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix. +Warning: Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix. +Download http://localhost:4545/npm/registry/@types/node +Download http://localhost:4545/npm/registry/@types/node/node-18.16.19.tgz +Check file:///[WILDLINE]/mod.ts +Checking for slow types in the public API... +Check file:///[WILDLINE]/mod.ts +Simulating publish of @foo/bar@1.0.0 with files: + file:///[WILDLINE]/deno.json (87B) + file:///[WILDLINE]/mod.ts (121B) +Warning Aborting due to --dry-run diff --git a/tests/specs/publish/bare_node_builtins/deno.json b/tests/specs/publish/bare_node_builtins/deno.json new file mode 100644 index 000000000..213a7cec6 --- /dev/null +++ b/tests/specs/publish/bare_node_builtins/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/bare_node_builtins/mod.ts b/tests/specs/publish/bare_node_builtins/mod.ts new file mode 100644 index 000000000..04374d8b7 --- /dev/null +++ b/tests/specs/publish/bare_node_builtins/mod.ts @@ -0,0 +1,5 @@ +import * as url from "url"; + +export function foobar(): { href: string } { + return url.pathToFileURL("/foo/bar"); +} diff --git a/tests/specs/publish/bare_node_builtins/no_warnings.out b/tests/specs/publish/bare_node_builtins/no_warnings.out new file mode 100644 index 000000000..f9a11f37c --- /dev/null +++ b/tests/specs/publish/bare_node_builtins/no_warnings.out @@ -0,0 +1,5 @@ +Checking for slow types in the public API... +Simulating publish of @foo/bar@1.0.0 with files: + file:///[WILDLINE]/deno.json (87B) + file:///[WILDLINE]/mod.ts (121B) +Warning Aborting due to --dry-run diff --git a/tests/specs/publish/config_file_jsonc/__test__.jsonc b/tests/specs/publish/config_file_jsonc/__test__.jsonc new file mode 100644 index 000000000..bef8ce4ca --- /dev/null +++ b/tests/specs/publish/config_file_jsonc/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "deno_jsonc.out" +} diff --git a/tests/specs/publish/config_file_jsonc/deno.jsonc b/tests/specs/publish/config_file_jsonc/deno.jsonc new file mode 100644 index 000000000..4c9dfb08c --- /dev/null +++ b/tests/specs/publish/config_file_jsonc/deno.jsonc @@ -0,0 +1,11 @@ +{ + // It's .jsonc file so it can have comments + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/specs/publish/config_file_jsonc/deno_jsonc.out b/tests/specs/publish/config_file_jsonc/deno_jsonc.out new file mode 100644 index 000000000..af45ed598 --- /dev/null +++ b/tests/specs/publish/config_file_jsonc/deno_jsonc.out @@ -0,0 +1,6 @@ +Check file:///[WILDCARD]/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/config_file_jsonc/mod.ts b/tests/specs/publish/config_file_jsonc/mod.ts new file mode 100644 index 000000000..6e8a61bae --- /dev/null +++ b/tests/specs/publish/config_file_jsonc/mod.ts @@ -0,0 +1,7 @@ +import http from "@std/http"; + +export function foobar(): { fileServer(): void } { + return { + fileServer: http.fileServer, + }; +} diff --git a/tests/specs/publish/config_file_jsonc/std_http.ts b/tests/specs/publish/config_file_jsonc/std_http.ts new file mode 100644 index 000000000..9d57b36f3 --- /dev/null +++ b/tests/specs/publish/config_file_jsonc/std_http.ts @@ -0,0 +1,6 @@ +// temp until we get jsr:@std/http in the test server +export default { + fileServer() { + console.log("Hi"); + }, +}; diff --git a/tests/specs/publish/config_flag/__test__.jsonc b/tests/specs/publish/config_flag/__test__.jsonc new file mode 100644 index 000000000..289f9abc9 --- /dev/null +++ b/tests/specs/publish/config_flag/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf' --config=successful/deno.json", + "output": "successful.out" +} diff --git a/tests/specs/publish/config_flag/successful.out b/tests/specs/publish/config_flag/successful.out new file mode 100644 index 000000000..78265361a --- /dev/null +++ b/tests/specs/publish/config_flag/successful.out @@ -0,0 +1,6 @@ +Check file:///[WILDCARD]/successful/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/successful/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/config_flag/successful/deno.json b/tests/specs/publish/config_flag/successful/deno.json new file mode 100644 index 000000000..fefab899b --- /dev/null +++ b/tests/specs/publish/config_flag/successful/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/specs/publish/config_flag/successful/mod.ts b/tests/specs/publish/config_flag/successful/mod.ts new file mode 100644 index 000000000..6e8a61bae --- /dev/null +++ b/tests/specs/publish/config_flag/successful/mod.ts @@ -0,0 +1,7 @@ +import http from "@std/http"; + +export function foobar(): { fileServer(): void } { + return { + fileServer: http.fileServer, + }; +} diff --git a/tests/specs/publish/config_flag/successful/std_http.ts b/tests/specs/publish/config_flag/successful/std_http.ts new file mode 100644 index 000000000..9d57b36f3 --- /dev/null +++ b/tests/specs/publish/config_flag/successful/std_http.ts @@ -0,0 +1,6 @@ +// temp until we get jsr:@std/http in the test server +export default { + fileServer() { + console.log("Hi"); + }, +}; diff --git a/tests/specs/publish/dry_run/__test__.jsonc b/tests/specs/publish/dry_run/__test__.jsonc new file mode 100644 index 000000000..3ca6ff4d3 --- /dev/null +++ b/tests/specs/publish/dry_run/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf' --dry-run", + "output": "dry_run.out" +} diff --git a/tests/specs/publish/dry_run/deno.json b/tests/specs/publish/dry_run/deno.json new file mode 100644 index 000000000..fefab899b --- /dev/null +++ b/tests/specs/publish/dry_run/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/specs/publish/dry_run/dry_run.out b/tests/specs/publish/dry_run/dry_run.out new file mode 100644 index 000000000..afc2ba66a --- /dev/null +++ b/tests/specs/publish/dry_run/dry_run.out @@ -0,0 +1,8 @@ +Check file:///[WILDCARD]/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/mod.ts +Simulating publish of @foo/bar@1.0.0 with files: + [WILDCARD]deno.json (140B) + [WILDCARD]mod.ts (137B) + [WILDCARD]std_http.ts (119B) +Warning Aborting due to --dry-run diff --git a/tests/specs/publish/dry_run/mod.ts b/tests/specs/publish/dry_run/mod.ts new file mode 100644 index 000000000..6e8a61bae --- /dev/null +++ b/tests/specs/publish/dry_run/mod.ts @@ -0,0 +1,7 @@ +import http from "@std/http"; + +export function foobar(): { fileServer(): void } { + return { + fileServer: http.fileServer, + }; +} diff --git a/tests/specs/publish/dry_run/std_http.ts b/tests/specs/publish/dry_run/std_http.ts new file mode 100644 index 000000000..9d57b36f3 --- /dev/null +++ b/tests/specs/publish/dry_run/std_http.ts @@ -0,0 +1,6 @@ +// temp until we get jsr:@std/http in the test server +export default { + fileServer() { + console.log("Hi"); + }, +}; diff --git a/tests/specs/publish/has_slow_types/__test__.jsonc b/tests/specs/publish/has_slow_types/__test__.jsonc new file mode 100644 index 000000000..470bae81b --- /dev/null +++ b/tests/specs/publish/has_slow_types/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "has_slow_types.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/has_slow_types/deno.json b/tests/specs/publish/has_slow_types/deno.json new file mode 100644 index 000000000..5826e5529 --- /dev/null +++ b/tests/specs/publish/has_slow_types/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.1.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/has_slow_types/has_slow_types.out b/tests/specs/publish/has_slow_types/has_slow_types.out new file mode 100644 index 000000000..43ac86658 --- /dev/null +++ b/tests/specs/publish/has_slow_types/has_slow_types.out @@ -0,0 +1,22 @@ +Check file:///[WILDCARD]/mod.ts +Checking for slow types in the public API... +error[missing-explicit-return-type]: missing explicit return type in the public API + --> [WILDCARD]mod.ts:2:17 + | +2 | export function getRandom() { + | ^^^^^^^^^ this function is missing an explicit return type + = hint: add an explicit return type to the function + + info: all functions in the public API must have an explicit return type + docs: https://jsr.io/go/slow-type-missing-explicit-return-type + +This package contains errors for slow types. Fixing these errors will: + + 1. Significantly improve your package users' type checking performance. + 2. Improve the automatic documentation generation. + 3. Enable automatic .d.ts generation for Node.js. + +Don't want to bother? You can choose to skip this step by +providing the --allow-slow-types flag. + +error: Found 1 problem diff --git a/tests/specs/publish/has_slow_types/mod.ts b/tests/specs/publish/has_slow_types/mod.ts new file mode 100644 index 000000000..025311049 --- /dev/null +++ b/tests/specs/publish/has_slow_types/mod.ts @@ -0,0 +1,4 @@ +// requires an explicit type annotation of `number` +export function getRandom() { + return Math.random(); +} diff --git a/tests/specs/publish/invalid_import/__test__.jsonc b/tests/specs/publish/invalid_import/__test__.jsonc new file mode 100644 index 000000000..5436a04f8 --- /dev/null +++ b/tests/specs/publish/invalid_import/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf' --dry-run", + "output": "invalid_import.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/invalid_import/deno.json b/tests/specs/publish/invalid_import/deno.json new file mode 100644 index 000000000..49b666d22 --- /dev/null +++ b/tests/specs/publish/invalid_import/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "imports": { + "$echo": "http://localhost:4545/echo.ts" + }, + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/invalid_import/invalid_import.out b/tests/specs/publish/invalid_import/invalid_import.out new file mode 100644 index 000000000..f6742de95 --- /dev/null +++ b/tests/specs/publish/invalid_import/invalid_import.out @@ -0,0 +1,32 @@ +Download http://localhost:4545/welcome.ts +Download http://localhost:4545/echo.ts +Download http://localhost:4545/npm/registry/chalk +Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz +Check file:///[WILDCARD]/mod.ts +Checking for slow types in the public API... +Check file://[WILDCARD]mod.ts +error[invalid-external-import]: invalid import to a non-JSR 'http' specifier + --> [WILDCARD]mod.ts:1:8 + | +1 | import "http://localhost:4545/welcome.ts"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the specifier + = hint: replace this import with one from jsr or npm, or vendor the dependency into your package + + info: the import was resolved to 'http://localhost:4545/welcome.ts' + info: this specifier is not allowed to be imported on jsr + info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers + docs: https://jsr.io/go/invalid-external-import + +error[invalid-external-import]: invalid import to a non-JSR 'http' specifier + --> [WILDCARD]mod.ts:2:8 + | +2 | import "$echo"; + | ^^^^^^^ the specifier + = hint: replace this import with one from jsr or npm, or vendor the dependency into your package + + info: the import was resolved to 'http://localhost:4545/echo.ts' + info: this specifier is not allowed to be imported on jsr + info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers + docs: https://jsr.io/go/invalid-external-import + +error: Found 2 problems diff --git a/tests/specs/publish/invalid_import/mod.ts b/tests/specs/publish/invalid_import/mod.ts new file mode 100644 index 000000000..bdaf010e2 --- /dev/null +++ b/tests/specs/publish/invalid_import/mod.ts @@ -0,0 +1,9 @@ +import "http://localhost:4545/welcome.ts"; +import "$echo"; + +import "data:application/javascript,console.log(1)"; +import "npm:chalk@5"; + +export function foobar(): string { + return "string"; +} diff --git a/tests/specs/publish/invalid_import_esm_sh_suggestion/__test__.jsonc b/tests/specs/publish/invalid_import_esm_sh_suggestion/__test__.jsonc new file mode 100644 index 000000000..6a6c3bdec --- /dev/null +++ b/tests/specs/publish/invalid_import_esm_sh_suggestion/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf' --dry-run", + "output": "invalid_import_esm_sh_suggestion.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/invalid_import_esm_sh_suggestion/deno.json b/tests/specs/publish/invalid_import_esm_sh_suggestion/deno.json new file mode 100644 index 000000000..49b666d22 --- /dev/null +++ b/tests/specs/publish/invalid_import_esm_sh_suggestion/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "imports": { + "$echo": "http://localhost:4545/echo.ts" + }, + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out b/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out new file mode 100644 index 000000000..a014f3de6 --- /dev/null +++ b/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out @@ -0,0 +1,20 @@ +[WILDCARD] +Check file:///[WILDCARD]/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]mod.ts +error[invalid-external-import]: invalid import to a non-JSR 'http' specifier + --> [WILDCARD]mod.ts:1:8 + | +1 | import "http://esm.sh/react-dom@18.2.0/server"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the specifier + = hint: replace this import with one from jsr or npm, or vendor the dependency into your package + | +1 | "npm:react-dom@18.2.0" + | ---------------------- try this specifier + + info: the import was resolved to 'http://esm.sh/react-dom@18.2.0/server' + info: this specifier is not allowed to be imported on jsr + info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers + docs: https://jsr.io/go/invalid-external-import + +error: Found 1 problem diff --git a/tests/specs/publish/invalid_import_esm_sh_suggestion/mod.ts b/tests/specs/publish/invalid_import_esm_sh_suggestion/mod.ts new file mode 100644 index 000000000..e597218ed --- /dev/null +++ b/tests/specs/publish/invalid_import_esm_sh_suggestion/mod.ts @@ -0,0 +1,5 @@ +import "http://esm.sh/react-dom@18.2.0/server"; + +export function foobar(): string { + return "string"; +} diff --git a/tests/specs/publish/invalid_path/__test__.jsonc b/tests/specs/publish/invalid_path/__test__.jsonc new file mode 100644 index 000000000..24f9c0dfa --- /dev/null +++ b/tests/specs/publish/invalid_path/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "invalid_path.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/invalid_path/deno.json b/tests/specs/publish/invalid_path/deno.json new file mode 100644 index 000000000..213a7cec6 --- /dev/null +++ b/tests/specs/publish/invalid_path/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/invalid_path/invalid_path.out b/tests/specs/publish/invalid_path/invalid_path.out new file mode 100644 index 000000000..d47cb01de --- /dev/null +++ b/tests/specs/publish/invalid_path/invalid_path.out @@ -0,0 +1,11 @@ +Check file://[WILDCARD]mod.ts +Checking for slow types in the public API... +Check file://[WILDCARD]mod.ts +error[invalid-path]: package path must not contain whitespace (found ' ') + --> [WILDCARD]path with spaces.txt + = hint: rename or remove the file, or add it to 'publish.exclude' in the config file + + info: to portably support all platforms, including windows, the allowed characters in package paths are limited + docs: https://jsr.io/go/invalid-path + +error: Found 1 problem diff --git a/tests/specs/publish/invalid_path/mod.ts b/tests/specs/publish/invalid_path/mod.ts new file mode 100644 index 000000000..9e217d9b0 --- /dev/null +++ b/tests/specs/publish/invalid_path/mod.ts @@ -0,0 +1,3 @@ +export function foobar(): string { + return "string"; +} diff --git a/tests/specs/publish/invalid_path/path with spaces.txt b/tests/specs/publish/invalid_path/path with spaces.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/publish/javascript_decl_file/__test__.jsonc b/tests/specs/publish/javascript_decl_file/__test__.jsonc new file mode 100644 index 000000000..0b6b0888e --- /dev/null +++ b/tests/specs/publish/javascript_decl_file/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "javascript_decl_file.out", + "exitCode": 0 +} diff --git a/tests/specs/publish/javascript_decl_file/deno.json b/tests/specs/publish/javascript_decl_file/deno.json new file mode 100644 index 000000000..e5dbfa8d3 --- /dev/null +++ b/tests/specs/publish/javascript_decl_file/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.js" + } +} diff --git a/tests/specs/publish/javascript_decl_file/javascript_decl_file.out b/tests/specs/publish/javascript_decl_file/javascript_decl_file.out new file mode 100644 index 000000000..48128e82f --- /dev/null +++ b/tests/specs/publish/javascript_decl_file/javascript_decl_file.out @@ -0,0 +1,5 @@ +Check file:///[WILDCARD]/javascript_decl_file/mod.js +Checking for slow types in the public API... +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/javascript_decl_file/mod.d.ts b/tests/specs/publish/javascript_decl_file/mod.d.ts new file mode 100644 index 000000000..b2f6c69a8 --- /dev/null +++ b/tests/specs/publish/javascript_decl_file/mod.d.ts @@ -0,0 +1 @@ +export function getRandom(): number; diff --git a/tests/specs/publish/javascript_decl_file/mod.js b/tests/specs/publish/javascript_decl_file/mod.js new file mode 100644 index 000000000..2395e622b --- /dev/null +++ b/tests/specs/publish/javascript_decl_file/mod.js @@ -0,0 +1,5 @@ +/// + +export function getRandom() { + return Math.random(); +} diff --git a/tests/specs/publish/javascript_missing_decl_file/__test__.jsonc b/tests/specs/publish/javascript_missing_decl_file/__test__.jsonc new file mode 100644 index 000000000..1e760cf22 --- /dev/null +++ b/tests/specs/publish/javascript_missing_decl_file/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "javascript_missing_decl_file.out", + "exitCode": 0 +} diff --git a/tests/specs/publish/javascript_missing_decl_file/deno.json b/tests/specs/publish/javascript_missing_decl_file/deno.json new file mode 100644 index 000000000..e12927c26 --- /dev/null +++ b/tests/specs/publish/javascript_missing_decl_file/deno.json @@ -0,0 +1,8 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.js", + "./other": "./other.js" + } +} diff --git a/tests/specs/publish/javascript_missing_decl_file/javascript_missing_decl_file.out b/tests/specs/publish/javascript_missing_decl_file/javascript_missing_decl_file.out new file mode 100644 index 000000000..08e92e320 --- /dev/null +++ b/tests/specs/publish/javascript_missing_decl_file/javascript_missing_decl_file.out @@ -0,0 +1,20 @@ +Checking for slow types in the public API... +warning[unsupported-javascript-entrypoint]: used a JavaScript module without type declarations as an entrypoint + --> [WILDCARD]mod.js + = hint: add a type declaration (d.ts) for the JavaScript module, or rewrite it to TypeScript + + info: JavaScript files with no corresponding declaration require type inference to be type checked + info: fast check avoids type inference, so JavaScript entrypoints should be avoided + docs: https://jsr.io/go/slow-type-unsupported-javascript-entrypoint + +warning[unsupported-javascript-entrypoint]: used a JavaScript module without type declarations as an entrypoint + --> [WILDCARD]other.js + = hint: add a type declaration (d.ts) for the JavaScript module, or rewrite it to TypeScript + + info: JavaScript files with no corresponding declaration require type inference to be type checked + info: fast check avoids type inference, so JavaScript entrypoints should be avoided + docs: https://jsr.io/go/slow-type-unsupported-javascript-entrypoint + +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/javascript_missing_decl_file/mod.js b/tests/specs/publish/javascript_missing_decl_file/mod.js new file mode 100644 index 000000000..4a62fa5b4 --- /dev/null +++ b/tests/specs/publish/javascript_missing_decl_file/mod.js @@ -0,0 +1,3 @@ +export function getRandom() { + return Math.random(); +} diff --git a/tests/specs/publish/javascript_missing_decl_file/other.js b/tests/specs/publish/javascript_missing_decl_file/other.js new file mode 100644 index 000000000..89ffb80ba --- /dev/null +++ b/tests/specs/publish/javascript_missing_decl_file/other.js @@ -0,0 +1,3 @@ +export function other() { + return Math.random(); +} diff --git a/tests/specs/publish/jsr_jsonc/__test__.jsonc b/tests/specs/publish/jsr_jsonc/__test__.jsonc new file mode 100644 index 000000000..774d5a534 --- /dev/null +++ b/tests/specs/publish/jsr_jsonc/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "mod.out" +} diff --git a/tests/specs/publish/jsr_jsonc/jsr.jsonc b/tests/specs/publish/jsr_jsonc/jsr.jsonc new file mode 100644 index 000000000..4c9dfb08c --- /dev/null +++ b/tests/specs/publish/jsr_jsonc/jsr.jsonc @@ -0,0 +1,11 @@ +{ + // It's .jsonc file so it can have comments + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/specs/publish/jsr_jsonc/mod.out b/tests/specs/publish/jsr_jsonc/mod.out new file mode 100644 index 000000000..38b61d568 --- /dev/null +++ b/tests/specs/publish/jsr_jsonc/mod.out @@ -0,0 +1,6 @@ +Check file:///[WILDCARD]/publish/jsr_jsonc/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/publish/jsr_jsonc/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/jsr_jsonc/mod.ts b/tests/specs/publish/jsr_jsonc/mod.ts new file mode 100644 index 000000000..6e8a61bae --- /dev/null +++ b/tests/specs/publish/jsr_jsonc/mod.ts @@ -0,0 +1,7 @@ +import http from "@std/http"; + +export function foobar(): { fileServer(): void } { + return { + fileServer: http.fileServer, + }; +} diff --git a/tests/specs/publish/jsr_jsonc/std_http.ts b/tests/specs/publish/jsr_jsonc/std_http.ts new file mode 100644 index 000000000..9d57b36f3 --- /dev/null +++ b/tests/specs/publish/jsr_jsonc/std_http.ts @@ -0,0 +1,6 @@ +// temp until we get jsr:@std/http in the test server +export default { + fileServer() { + console.log("Hi"); + }, +}; diff --git a/tests/specs/publish/missing_deno_json/__test__.jsonc b/tests/specs/publish/missing_deno_json/__test__.jsonc new file mode 100644 index 000000000..614caecd6 --- /dev/null +++ b/tests/specs/publish/missing_deno_json/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "missing_deno_json.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/missing_deno_json/main.ts b/tests/specs/publish/missing_deno_json/main.ts new file mode 100644 index 000000000..8d9b8a22a --- /dev/null +++ b/tests/specs/publish/missing_deno_json/main.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/publish/missing_deno_json/missing_deno_json.out b/tests/specs/publish/missing_deno_json/missing_deno_json.out new file mode 100644 index 000000000..2c074bf83 --- /dev/null +++ b/tests/specs/publish/missing_deno_json/missing_deno_json.out @@ -0,0 +1 @@ +error: Couldn't find a deno.json, deno.jsonc, jsr.json or jsr.jsonc configuration file in [WILDCARD] \ No newline at end of file diff --git a/tests/specs/publish/no_check/__test__.jsonc b/tests/specs/publish/no_check/__test__.jsonc new file mode 100644 index 000000000..e89cd7a57 --- /dev/null +++ b/tests/specs/publish/no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf' --no-check", + "output": "successful_no_check.out" +} diff --git a/tests/specs/publish/no_check/deno.json b/tests/specs/publish/no_check/deno.json new file mode 100644 index 000000000..fefab899b --- /dev/null +++ b/tests/specs/publish/no_check/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/specs/publish/no_check/mod.ts b/tests/specs/publish/no_check/mod.ts new file mode 100644 index 000000000..6e8a61bae --- /dev/null +++ b/tests/specs/publish/no_check/mod.ts @@ -0,0 +1,7 @@ +import http from "@std/http"; + +export function foobar(): { fileServer(): void } { + return { + fileServer: http.fileServer, + }; +} diff --git a/tests/specs/publish/no_check/std_http.ts b/tests/specs/publish/no_check/std_http.ts new file mode 100644 index 000000000..9d57b36f3 --- /dev/null +++ b/tests/specs/publish/no_check/std_http.ts @@ -0,0 +1,6 @@ +// temp until we get jsr:@std/http in the test server +export default { + fileServer() { + console.log("Hi"); + }, +}; diff --git a/tests/specs/publish/no_check/successful_no_check.out b/tests/specs/publish/no_check/successful_no_check.out new file mode 100644 index 000000000..01c53a9ba --- /dev/null +++ b/tests/specs/publish/no_check/successful_no_check.out @@ -0,0 +1,4 @@ +Checking for slow types in the public API... +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/no_token/__test__.jsonc b/tests/specs/publish/no_token/__test__.jsonc new file mode 100644 index 000000000..f8a7fa942 --- /dev/null +++ b/tests/specs/publish/no_token/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish", + "output": "no_token.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/no_token/main.ts b/tests/specs/publish/no_token/main.ts new file mode 100644 index 000000000..8d9b8a22a --- /dev/null +++ b/tests/specs/publish/no_token/main.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/publish/no_token/no_token.out b/tests/specs/publish/no_token/no_token.out new file mode 100644 index 000000000..41415094c --- /dev/null +++ b/tests/specs/publish/no_token/no_token.out @@ -0,0 +1 @@ +error: No means to authenticate. Pass a token to `--token`[WILDCARD] diff --git a/tests/specs/publish/node_specifier/__test__.jsonc b/tests/specs/publish/node_specifier/__test__.jsonc new file mode 100644 index 000000000..f845f2479 --- /dev/null +++ b/tests/specs/publish/node_specifier/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "node_specifier.out" +} diff --git a/tests/specs/publish/node_specifier/deno.json b/tests/specs/publish/node_specifier/deno.json new file mode 100644 index 000000000..213a7cec6 --- /dev/null +++ b/tests/specs/publish/node_specifier/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/node_specifier/mod.ts b/tests/specs/publish/node_specifier/mod.ts new file mode 100644 index 000000000..9d8263709 --- /dev/null +++ b/tests/specs/publish/node_specifier/mod.ts @@ -0,0 +1,5 @@ +import "node:http"; + +export function foobar(): string { + return "string"; +} diff --git a/tests/specs/publish/node_specifier/node_specifier.out b/tests/specs/publish/node_specifier/node_specifier.out new file mode 100644 index 000000000..d3e4a367b --- /dev/null +++ b/tests/specs/publish/node_specifier/node_specifier.out @@ -0,0 +1,8 @@ +Download http://localhost:4545/npm/registry/@types/node +Download http://localhost:4545/npm/registry/@types/node/node-[WILDCARD].tgz +Check file:///[WILDCARD]/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/publish/node_specifier/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/package_json/__test__.jsonc b/tests/specs/publish/package_json/__test__.jsonc new file mode 100644 index 000000000..c4e954a6e --- /dev/null +++ b/tests/specs/publish/package_json/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "package_json.out" +} diff --git a/tests/specs/publish/package_json/deno.json b/tests/specs/publish/package_json/deno.json new file mode 100644 index 000000000..6e2826ef5 --- /dev/null +++ b/tests/specs/publish/package_json/deno.json @@ -0,0 +1,8 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "nodeModulesDir": false +} diff --git a/tests/specs/publish/package_json/mod.ts b/tests/specs/publish/package_json/mod.ts new file mode 100644 index 000000000..ae98962fa --- /dev/null +++ b/tests/specs/publish/package_json/mod.ts @@ -0,0 +1,9 @@ +import pc from "picocolors"; + +export function add(a: number, b: number): number { + return a + b; +} + +export function getValue(): string { + return pc.green("hey"); +} diff --git a/tests/specs/publish/package_json/package.json b/tests/specs/publish/package_json/package.json new file mode 100644 index 000000000..c1b171f4c --- /dev/null +++ b/tests/specs/publish/package_json/package.json @@ -0,0 +1,7 @@ +{ + "name": "@deno/foo", + "version": "0.0.1", + "dependencies": { + "picocolors": "*" + } +} diff --git a/tests/specs/publish/package_json/package_json.out b/tests/specs/publish/package_json/package_json.out new file mode 100644 index 000000000..7b54ce8da --- /dev/null +++ b/tests/specs/publish/package_json/package_json.out @@ -0,0 +1,8 @@ +Download http://localhost:4545/npm/registry/picocolors +Download http://localhost:4545/npm/registry/picocolors/picocolors-1.0.0.tgz +Check file:///[WILDCARD]/publish/package_json/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/publish/package_json/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/sloppy_imports/__test__.jsonc b/tests/specs/publish/sloppy_imports/__test__.jsonc new file mode 100644 index 000000000..bfb3d38dd --- /dev/null +++ b/tests/specs/publish/sloppy_imports/__test__.jsonc @@ -0,0 +1,21 @@ +{ + "envs": { + "DISABLE_JSR_PROVENANCE": "true", + "DENO_TESTING_DISABLE_GIT_CHECK": "1" + }, + "tempDir": true, + "steps": [{ + "args": "publish --token 'sadfasdf' --dry-run --unstable-sloppy-imports", + "output": "sloppy_imports.out" + }, { + "args": "publish --token 'sadfasdf' --dry-run", + "output": "sloppy_imports_not_enabled.out", + "exitCode": 1 + }, { + "args": "publish --token 'sadfasdf' --dry-run --unstable-sloppy-imports", + "output": "sloppy_imports_no_warnings.out", + "envs": { + "DENO_DISABLE_PEDANTIC_NODE_WARNINGS": "1" + } + }] +} diff --git a/tests/specs/publish/sloppy_imports/b/index.ts b/tests/specs/publish/sloppy_imports/b/index.ts new file mode 100644 index 000000000..1392bf6ba --- /dev/null +++ b/tests/specs/publish/sloppy_imports/b/index.ts @@ -0,0 +1 @@ +export const PI = Math.PI; diff --git a/tests/specs/publish/sloppy_imports/deno.json b/tests/specs/publish/sloppy_imports/deno.json new file mode 100644 index 000000000..213a7cec6 --- /dev/null +++ b/tests/specs/publish/sloppy_imports/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/sloppy_imports/mod.ts b/tests/specs/publish/sloppy_imports/mod.ts new file mode 100644 index 000000000..f5084bb3b --- /dev/null +++ b/tests/specs/publish/sloppy_imports/mod.ts @@ -0,0 +1 @@ +export { PI } from "./b"; diff --git a/tests/specs/publish/sloppy_imports/sloppy_imports.out b/tests/specs/publish/sloppy_imports/sloppy_imports.out new file mode 100644 index 000000000..bfa258b93 --- /dev/null +++ b/tests/specs/publish/sloppy_imports/sloppy_imports.out @@ -0,0 +1,10 @@ +Warning Sloppy module resolution (hint: specify path to index.ts file in directory instead) + at file:///[WILDCARD]/mod.ts:1:20 +Check file:///[WILDCARD]/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/mod.ts +Simulating publish of @foo/bar@1.0.0 with files: + file:///[WILDCARD]/b/index.ts (27B) + file:///[WILDCARD]/deno.json (87B) + file:///[WILDCARD]/mod.ts (35B) +Warning Aborting due to --dry-run diff --git a/tests/specs/publish/sloppy_imports/sloppy_imports_no_warnings.out b/tests/specs/publish/sloppy_imports/sloppy_imports_no_warnings.out new file mode 100644 index 000000000..72ff281a3 --- /dev/null +++ b/tests/specs/publish/sloppy_imports/sloppy_imports_no_warnings.out @@ -0,0 +1,6 @@ +Checking for slow types in the public API... +Simulating publish of @foo/bar@1.0.0 with files: + file:///[WILDCARD]/b/index.ts (27B) + file:///[WILDCARD]/deno.json (87B) + file:///[WILDCARD]/mod.ts (35B) +Warning Aborting due to --dry-run diff --git a/tests/specs/publish/sloppy_imports/sloppy_imports_not_enabled.out b/tests/specs/publish/sloppy_imports/sloppy_imports_not_enabled.out new file mode 100644 index 000000000..4eacbea65 --- /dev/null +++ b/tests/specs/publish/sloppy_imports/sloppy_imports_not_enabled.out @@ -0,0 +1,2 @@ +error: [WILDCARD] Maybe specify path to 'index.ts' file in directory instead or run with --unstable-sloppy-imports + at file:///[WILDCARD]/mod.ts:1:20 diff --git a/tests/specs/publish/successful/__test__.jsonc b/tests/specs/publish/successful/__test__.jsonc new file mode 100644 index 000000000..fe5287e71 --- /dev/null +++ b/tests/specs/publish/successful/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "successful.out" +} diff --git a/tests/specs/publish/successful/deno.json b/tests/specs/publish/successful/deno.json new file mode 100644 index 000000000..fefab899b --- /dev/null +++ b/tests/specs/publish/successful/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/specs/publish/successful/mod.ts b/tests/specs/publish/successful/mod.ts new file mode 100644 index 000000000..6e8a61bae --- /dev/null +++ b/tests/specs/publish/successful/mod.ts @@ -0,0 +1,7 @@ +import http from "@std/http"; + +export function foobar(): { fileServer(): void } { + return { + fileServer: http.fileServer, + }; +} diff --git a/tests/specs/publish/successful/std_http.ts b/tests/specs/publish/successful/std_http.ts new file mode 100644 index 000000000..9d57b36f3 --- /dev/null +++ b/tests/specs/publish/successful/std_http.ts @@ -0,0 +1,6 @@ +// temp until we get jsr:@std/http in the test server +export default { + fileServer() { + console.log("Hi"); + }, +}; diff --git a/tests/specs/publish/successful/successful.out b/tests/specs/publish/successful/successful.out new file mode 100644 index 000000000..a3da4290d --- /dev/null +++ b/tests/specs/publish/successful/successful.out @@ -0,0 +1,6 @@ +Check file:///[WILDCARD]/publish/successful/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/publish/successful/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/symlink/__test__.jsonc b/tests/specs/publish/symlink/__test__.jsonc new file mode 100644 index 000000000..32da3baff --- /dev/null +++ b/tests/specs/publish/symlink/__test__.jsonc @@ -0,0 +1,15 @@ +{ + "tempDir": true, + "envs": { + "DISABLE_JSR_PROVENANCE": "true", + "DENO_TESTING_DISABLE_GIT_CHECK": "1" + }, + "steps": [{ + "args": ["eval", "Deno.symlinkSync('./mod.ts', './symlink');"], + "output": "[WILDCARD]" + }, { + "args": "publish --token 'sadfasdf' --dry-run", + "output": "symlink.out", + "exitCode": 0 + }] +} diff --git a/tests/specs/publish/symlink/deno.json b/tests/specs/publish/symlink/deno.json new file mode 100644 index 000000000..213a7cec6 --- /dev/null +++ b/tests/specs/publish/symlink/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/symlink/mod.ts b/tests/specs/publish/symlink/mod.ts new file mode 100644 index 000000000..9e217d9b0 --- /dev/null +++ b/tests/specs/publish/symlink/mod.ts @@ -0,0 +1,3 @@ +export function foobar(): string { + return "string"; +} diff --git a/tests/specs/publish/symlink/symlink.out b/tests/specs/publish/symlink/symlink.out new file mode 100644 index 000000000..9f89f5b7c --- /dev/null +++ b/tests/specs/publish/symlink/symlink.out @@ -0,0 +1,15 @@ +Check [WILDCARD]mod.ts +Checking for slow types in the public API... +Check [WILDCARD]mod.ts +warning[unsupported-file-type]: unsupported file type 'symlink' + --> [WILDCARD]symlink + = hint: remove the file, or add it to 'publish.exclude' in the config file + + info: only files and directories are supported + info: the file was ignored and will not be published + docs: https://jsr.io/go/unsupported-file-type + +Simulating publish of @foo/bar@1.0.0 with files: + [WILDCARD]deno.json (87B) + [WILDCARD]mod.ts (56B) +Warning Aborting due to --dry-run diff --git a/tests/specs/publish/unanalyzable_dynamic_import/__test__.jsonc b/tests/specs/publish/unanalyzable_dynamic_import/__test__.jsonc new file mode 100644 index 000000000..45073b099 --- /dev/null +++ b/tests/specs/publish/unanalyzable_dynamic_import/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "unanalyzable_dynamic_import.out", + "exitCode": 0 +} diff --git a/tests/specs/publish/unanalyzable_dynamic_import/deno.json b/tests/specs/publish/unanalyzable_dynamic_import/deno.json new file mode 100644 index 000000000..213a7cec6 --- /dev/null +++ b/tests/specs/publish/unanalyzable_dynamic_import/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/unanalyzable_dynamic_import/mod.ts b/tests/specs/publish/unanalyzable_dynamic_import/mod.ts new file mode 100644 index 000000000..291311385 --- /dev/null +++ b/tests/specs/publish/unanalyzable_dynamic_import/mod.ts @@ -0,0 +1,2 @@ +const asd = "asd"; +await import("asd " + asd); diff --git a/tests/specs/publish/unanalyzable_dynamic_import/unanalyzable_dynamic_import.out b/tests/specs/publish/unanalyzable_dynamic_import/unanalyzable_dynamic_import.out new file mode 100644 index 000000000..7f3ca5555 --- /dev/null +++ b/tests/specs/publish/unanalyzable_dynamic_import/unanalyzable_dynamic_import.out @@ -0,0 +1,16 @@ +Check file://[WILDCARD]/mod.ts +Checking for slow types in the public API... +Check file://[WILDCARD]/mod.ts +warning[unanalyzable-dynamic-import]: unable to analyze dynamic import + --> [WILDCARD]mod.ts:2:14 + | +2 | await import("asd " + asd); + | ^^^^^^^^^^^^ the unanalyzable dynamic import + + info: after publishing this package, imports from the local import map / package.json do not work + info: dynamic imports that can not be analyzed at publish time will not be rewritten automatically + info: make sure the dynamic import is resolvable at runtime without an import map / package.json + +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/unsupported_jsx_tsx/__test__.jsonc b/tests/specs/publish/unsupported_jsx_tsx/__test__.jsonc new file mode 100644 index 000000000..774d5a534 --- /dev/null +++ b/tests/specs/publish/unsupported_jsx_tsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "mod.out" +} diff --git a/tests/specs/publish/unsupported_jsx_tsx/foo.jsx b/tests/specs/publish/unsupported_jsx_tsx/foo.jsx new file mode 100644 index 000000000..021c2d49e --- /dev/null +++ b/tests/specs/publish/unsupported_jsx_tsx/foo.jsx @@ -0,0 +1,5 @@ +import { renderToString } from "npm:preact-render-to-string"; + +export default function render() { + return renderToString(
foo.tsx
); +} diff --git a/tests/specs/publish/unsupported_jsx_tsx/foo.tsx b/tests/specs/publish/unsupported_jsx_tsx/foo.tsx new file mode 100644 index 000000000..021c2d49e --- /dev/null +++ b/tests/specs/publish/unsupported_jsx_tsx/foo.tsx @@ -0,0 +1,5 @@ +import { renderToString } from "npm:preact-render-to-string"; + +export default function render() { + return renderToString(
foo.tsx
); +} diff --git a/tests/specs/publish/unsupported_jsx_tsx/jsr.jsonc b/tests/specs/publish/unsupported_jsx_tsx/jsr.jsonc new file mode 100644 index 000000000..7aea08842 --- /dev/null +++ b/tests/specs/publish/unsupported_jsx_tsx/jsr.jsonc @@ -0,0 +1,11 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "npm:preact" + } +} diff --git a/tests/specs/publish/unsupported_jsx_tsx/mod.out b/tests/specs/publish/unsupported_jsx_tsx/mod.out new file mode 100644 index 000000000..5f085fb33 --- /dev/null +++ b/tests/specs/publish/unsupported_jsx_tsx/mod.out @@ -0,0 +1,17 @@ +[WILDCARD] +Check file:///[WILDCARD]/publish/unsupported_jsx_tsx/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/publish/unsupported_jsx_tsx/mod.ts +warning[unsupported-jsx-tsx]: JSX and TSX files are currently not supported + --> [WILDCARD]foo.jsx + + info: follow https://github.com/jsr-io/jsr/issues/24 for updates + +warning[unsupported-jsx-tsx]: JSX and TSX files are currently not supported + --> [WILDCARD]foo.tsx + + info: follow https://github.com/jsr-io/jsr/issues/24 for updates + +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/unsupported_jsx_tsx/mod.ts b/tests/specs/publish/unsupported_jsx_tsx/mod.ts new file mode 100644 index 000000000..4631a829d --- /dev/null +++ b/tests/specs/publish/unsupported_jsx_tsx/mod.ts @@ -0,0 +1,7 @@ +import fooTsx from "./foo.tsx"; +import fooJsx from "./foo.jsx"; + +export function renderTsxJsx() { + console.log(fooTsx()); + console.log(fooJsx()); +} diff --git a/tests/specs/publish/workspace/__test__.jsonc b/tests/specs/publish/workspace/__test__.jsonc new file mode 100644 index 000000000..7b1c04d56 --- /dev/null +++ b/tests/specs/publish/workspace/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "steps": [{ + "args": "publish --token 'sadfasdf'", + "output": "workspace.out" + }, { + "cwd": "./bar", + "args": "publish --token 'sadfasdf'", + "output": "workspace_individual.out" + }] +} diff --git a/tests/specs/publish/workspace/bar/deno.json b/tests/specs/publish/workspace/bar/deno.json new file mode 100644 index 000000000..213a7cec6 --- /dev/null +++ b/tests/specs/publish/workspace/bar/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/workspace/bar/mod.ts b/tests/specs/publish/workspace/bar/mod.ts new file mode 100644 index 000000000..8d9b8a22a --- /dev/null +++ b/tests/specs/publish/workspace/bar/mod.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/publish/workspace/deno.json b/tests/specs/publish/workspace/deno.json new file mode 100644 index 000000000..57602aab5 --- /dev/null +++ b/tests/specs/publish/workspace/deno.json @@ -0,0 +1,6 @@ +{ + "workspaces": [ + "foo", + "bar" + ] +} diff --git a/tests/specs/publish/workspace/foo/deno.json b/tests/specs/publish/workspace/foo/deno.json new file mode 100644 index 000000000..79563d36c --- /dev/null +++ b/tests/specs/publish/workspace/foo/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/foo", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "bar": "jsr:@foo/bar@1" + } +} diff --git a/tests/specs/publish/workspace/foo/mod.ts b/tests/specs/publish/workspace/foo/mod.ts new file mode 100644 index 000000000..adf584463 --- /dev/null +++ b/tests/specs/publish/workspace/foo/mod.ts @@ -0,0 +1,5 @@ +import * as bar from "bar"; + +export function add(a: number, b: number): number { + return bar.add(a, b); +} diff --git a/tests/specs/publish/workspace/workspace.out b/tests/specs/publish/workspace/workspace.out new file mode 100644 index 000000000..8c57bc2dd --- /dev/null +++ b/tests/specs/publish/workspace/workspace.out @@ -0,0 +1,12 @@ +Publishing a workspace... +Check file:///[WILDCARD]/foo/mod.ts +Check file:///[WILDCARD]/bar/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/foo/mod.ts +Check file:///[WILDCARD]/bar/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details +Publishing @foo/foo@1.0.0 ... +Successfully published @foo/foo@1.0.0 +Visit http://127.0.0.1:4250/@foo/foo@1.0.0 for details diff --git a/tests/specs/publish/workspace/workspace_individual.out b/tests/specs/publish/workspace/workspace_individual.out new file mode 100644 index 000000000..edb6b53aa --- /dev/null +++ b/tests/specs/publish/workspace/workspace_individual.out @@ -0,0 +1,6 @@ +Check file:///[WILDCARD]/bar/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/bar/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/run/no_deno_json/__test__.jsonc b/tests/specs/run/no_deno_json/__test__.jsonc new file mode 100644 index 000000000..67867f023 --- /dev/null +++ b/tests/specs/run/no_deno_json/__test__.jsonc @@ -0,0 +1,36 @@ +{ + "tempDir": true, + "steps": [{ + // --no-config + "args": "run -L debug -A --no-config noconfig.ts", + "output": "noconfig.out", + "cwd": "code" + }, { + // --no-npm + "args": "run -L debug -A --no-npm noconfig.ts", + "output": "noconfig.out", + "cwd": "code" + }, { + // not auto-discovered with env var + "args": "run -L debug -A noconfig.ts", + "output": "noconfig.out", + "cwd": "code", + "envs": { + "DENO_NO_PACKAGE_JSON": "1" + } + }, { + // this should not use --quiet because we should ensure no package.json install occurs + "args": "run -A no_package_json_imports.ts", + "output": "no_package_json_imports.out", + "cwd": "code" + }, { + // auto-discovered node_modules relative package.json + "args": "run -A main.js", + "output": "code/sub_dir/main.out", + "cwd": "code/sub_dir" + }, { + // auto-discovered for local script arg + "args": "run -L debug -A code/main.ts", // notice this is not in the sub dir + "output": "main.out" + }] +} diff --git a/tests/specs/run/no_deno_json/code/main.ts b/tests/specs/run/no_deno_json/code/main.ts new file mode 100644 index 000000000..1e6e50040 --- /dev/null +++ b/tests/specs/run/no_deno_json/code/main.ts @@ -0,0 +1,4 @@ +import chalk from "chalk"; + +console.log("ok"); +console.log(chalk); diff --git a/tests/specs/run/no_deno_json/code/no_package_json_imports.ts b/tests/specs/run/no_deno_json/code/no_package_json_imports.ts new file mode 100644 index 000000000..0f3785f91 --- /dev/null +++ b/tests/specs/run/no_deno_json/code/no_package_json_imports.ts @@ -0,0 +1 @@ +console.log(5); diff --git a/tests/specs/run/no_deno_json/code/noconfig.ts b/tests/specs/run/no_deno_json/code/noconfig.ts new file mode 100644 index 000000000..e6f77f92b --- /dev/null +++ b/tests/specs/run/no_deno_json/code/noconfig.ts @@ -0,0 +1,8 @@ +// ensure the cwd is this directory +const cwd = Deno.cwd(); +if (!cwd.endsWith("code")) { + console.log(cwd); + throw "FAIL"; +} else { + console.log("success"); +} diff --git a/tests/specs/run/no_deno_json/code/package.json b/tests/specs/run/no_deno_json/code/package.json new file mode 100644 index 000000000..a85b890a8 --- /dev/null +++ b/tests/specs/run/no_deno_json/code/package.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@denotest/check-error": "1.0.0", + "chalk": "4" + }, + "devDependencies": { + "@denotest/cjs-default-export": "1.0.0" + } +} diff --git a/tests/specs/run/no_deno_json/code/sub_dir/main.js b/tests/specs/run/no_deno_json/code/sub_dir/main.js new file mode 100644 index 000000000..492a8fa40 --- /dev/null +++ b/tests/specs/run/no_deno_json/code/sub_dir/main.js @@ -0,0 +1,3 @@ +import "chalk"; +console.log(Deno.cwd()); +console.log(Deno.statSync("../node_modules")); diff --git a/tests/specs/run/no_deno_json/code/sub_dir/main.out b/tests/specs/run/no_deno_json/code/sub_dir/main.out new file mode 100644 index 000000000..0ec791960 --- /dev/null +++ b/tests/specs/run/no_deno_json/code/sub_dir/main.out @@ -0,0 +1,7 @@ +Download http://[WILDCARD] +[WILDCARD]sub_dir +{ + [WILDCARD] + isDirectory: true, + [WILDCARD] +} diff --git a/tests/specs/run/no_deno_json/main.out b/tests/specs/run/no_deno_json/main.out new file mode 100644 index 000000000..92f5de748 --- /dev/null +++ b/tests/specs/run/no_deno_json/main.out @@ -0,0 +1,4 @@ +[WILDCARD]package.json file found at '[WILDCARD]code[WILDCHAR]package.json' +[WILDCARD] +ok +[Function (anonymous)] Chalk [WILDCARD] diff --git a/tests/specs/run/no_deno_json/no_package_json_imports.out b/tests/specs/run/no_deno_json/no_package_json_imports.out new file mode 100644 index 000000000..7ed6ff82d --- /dev/null +++ b/tests/specs/run/no_deno_json/no_package_json_imports.out @@ -0,0 +1 @@ +5 diff --git a/tests/specs/run/no_deno_json/noconfig.out b/tests/specs/run/no_deno_json/noconfig.out new file mode 100644 index 000000000..b9f9a6dea --- /dev/null +++ b/tests/specs/run/no_deno_json/noconfig.out @@ -0,0 +1,4 @@ +[WILDCARD]package.json auto-discovery is disabled +[WILDCARD] +success +[WILDCARD] diff --git a/tests/specs/schema.json b/tests/specs/schema.json index b3a30f936..94e069400 100644 --- a/tests/specs/schema.json +++ b/tests/specs/schema.json @@ -36,6 +36,9 @@ "type": "string" } }, + "flaky": { + "type": "boolean" + }, "if": { "type": "string", "examples": [ diff --git a/tests/specs/test/include_relative_pattern_dot_slash/__test__.jsonc b/tests/specs/test/include_relative_pattern_dot_slash/__test__.jsonc new file mode 100644 index 000000000..335c9ccd6 --- /dev/null +++ b/tests/specs/test/include_relative_pattern_dot_slash/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "test", + "output": "output.out" +} diff --git a/tests/specs/test/include_relative_pattern_dot_slash/deno.json b/tests/specs/test/include_relative_pattern_dot_slash/deno.json new file mode 100644 index 000000000..7c2c4a5d3 --- /dev/null +++ b/tests/specs/test/include_relative_pattern_dot_slash/deno.json @@ -0,0 +1,7 @@ +{ + "test": { + "include": [ + "./test/**/*.test.mjs" + ] + } +} diff --git a/tests/specs/test/include_relative_pattern_dot_slash/output.out b/tests/specs/test/include_relative_pattern_dot_slash/output.out new file mode 100644 index 000000000..be2961cff --- /dev/null +++ b/tests/specs/test/include_relative_pattern_dot_slash/output.out @@ -0,0 +1,5 @@ +running 1 test from ./test/add.test.mjs +should add ... ok ([WILDCARD]) + +ok | 1 passed | 0 failed ([WILDCARD]) + diff --git a/tests/specs/test/include_relative_pattern_dot_slash/test/add.mjs b/tests/specs/test/include_relative_pattern_dot_slash/test/add.mjs new file mode 100644 index 000000000..7d658310b --- /dev/null +++ b/tests/specs/test/include_relative_pattern_dot_slash/test/add.mjs @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/tests/specs/test/include_relative_pattern_dot_slash/test/add.test.mjs b/tests/specs/test/include_relative_pattern_dot_slash/test/add.test.mjs new file mode 100644 index 000000000..7b21d2fbc --- /dev/null +++ b/tests/specs/test/include_relative_pattern_dot_slash/test/add.test.mjs @@ -0,0 +1,7 @@ +import { add } from "./add.mjs"; + +Deno.test("should add", () => { + if (add(1, 2) !== 3) { + throw new Error("FAIL"); + } +}); diff --git a/tests/testdata/bench/allow_all.ts b/tests/testdata/bench/allow_all.ts deleted file mode 100644 index b31aaf397..000000000 --- a/tests/testdata/bench/allow_all.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { assertEquals } from "../../../tests/util/std/assert/mod.ts"; - -const permissions: Deno.PermissionName[] = [ - "read", - "write", - "net", - "env", - "run", - "ffi", - "hrtime", -]; - -for (const name of permissions) { - Deno.bench({ - name: `${name} false`, - permissions: { - [name]: false, - }, - async fn() { - for await (const n of permissions) { - const status = await Deno.permissions.query({ name: n }); - assertEquals(status.state, "prompt"); - } - }, - }); - - Deno.bench({ - name: `${name} true`, - permissions: { - [name]: true, - }, - async fn() { - for await (const n of permissions) { - const status = await Deno.permissions.query({ name: n }); - if (n === name) { - assertEquals(status.state, "granted"); - } else { - assertEquals(status.state, "prompt"); - } - } - }, - }); -} diff --git a/tests/testdata/bench/allow_none.ts b/tests/testdata/bench/allow_none.ts deleted file mode 100644 index 0cf3c27ef..000000000 --- a/tests/testdata/bench/allow_none.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { unreachable } from "../../../tests/util/std/assert/mod.ts"; - -const permissions: Deno.PermissionName[] = [ - "read", - "write", - "net", - "env", - "run", - "ffi", - "hrtime", -]; - -for (const name of permissions) { - Deno.bench({ - name, - permissions: { - [name]: true, - }, - fn() { - unreachable(); - }, - }); -} diff --git a/tests/testdata/bench/before_unload_prevent_default.ts b/tests/testdata/bench/before_unload_prevent_default.ts deleted file mode 100644 index 2759d4659..000000000 --- a/tests/testdata/bench/before_unload_prevent_default.ts +++ /dev/null @@ -1,6 +0,0 @@ -addEventListener("beforeunload", (e) => { - // The worker should be killed once benchmarks are done regardless of this. - e.preventDefault(); -}); - -Deno.bench("foo", () => {}); diff --git a/tests/testdata/bench/bench_formatting.ts b/tests/testdata/bench/bench_formatting.ts deleted file mode 100644 index fdee15abb..000000000 --- a/tests/testdata/bench/bench_formatting.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.bench("Date.now", () => { - Date.now(); -}); diff --git a/tests/testdata/bench/check_local_by_default.ts b/tests/testdata/bench/check_local_by_default.ts deleted file mode 100644 index 2ae8c2692..000000000 --- a/tests/testdata/bench/check_local_by_default.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/bench/check_local_by_default2.ts b/tests/testdata/bench/check_local_by_default2.ts deleted file mode 100644 index 5177ff944..000000000 --- a/tests/testdata/bench/check_local_by_default2.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/bench/clear_timeout.ts b/tests/testdata/bench/clear_timeout.ts deleted file mode 100644 index 4148263ac..000000000 --- a/tests/testdata/bench/clear_timeout.ts +++ /dev/null @@ -1,5 +0,0 @@ -clearTimeout(setTimeout(() => {}, 1000)); - -Deno.bench("bench1", () => {}); -Deno.bench("bench2", () => {}); -Deno.bench("bench3", () => {}); diff --git a/tests/testdata/bench/collect.out b/tests/testdata/bench/collect.out deleted file mode 100644 index 03c75922b..000000000 --- a/tests/testdata/bench/collect.out +++ /dev/null @@ -1,18 +0,0 @@ -Check [WILDCARD]/bench/collect/bench.ts -Check [WILDCARD]/bench/collect/include/2_bench.ts -Check [WILDCARD]/bench/collect/include/bench.ts -cpu: [WILDCARD] -runtime: deno [WILDCARD] ([WILDCARD]) - -[WILDCARD]/bench/collect/bench.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ---------------------------------------------------------------- ----------------------------- - -[WILDCARD]/bench/collect/include/2_bench.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ---------------------------------------------------------------- ----------------------------- - -[WILDCARD]/bench/collect/include/bench.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ---------------------------------------------------------------- ----------------------------- - diff --git a/tests/testdata/bench/collect/bench.ts b/tests/testdata/bench/collect/bench.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/bench/collect/deno.jsonc b/tests/testdata/bench/collect/deno.jsonc deleted file mode 100644 index 7f8f190d3..000000000 --- a/tests/testdata/bench/collect/deno.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "bench": { - "exclude": ["./ignore"] - } -} diff --git a/tests/testdata/bench/collect/deno.malformed.jsonc b/tests/testdata/bench/collect/deno.malformed.jsonc deleted file mode 100644 index 8e558fbcf..000000000 --- a/tests/testdata/bench/collect/deno.malformed.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "bench": { - "dont_know_this_field": {} - } -} diff --git a/tests/testdata/bench/collect/deno2.jsonc b/tests/testdata/bench/collect/deno2.jsonc deleted file mode 100644 index 653ab1e31..000000000 --- a/tests/testdata/bench/collect/deno2.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "bench": { - "include": ["./include/"], - "exclude": ["./ignore", "./include/2_bench.ts"] - } -} diff --git a/tests/testdata/bench/collect/ignore/bench.ts b/tests/testdata/bench/collect/ignore/bench.ts deleted file mode 100644 index 16fb63ba7..000000000 --- a/tests/testdata/bench/collect/ignore/bench.ts +++ /dev/null @@ -1 +0,0 @@ -throw new Error("this module should be ignored"); diff --git a/tests/testdata/bench/collect/include/2_bench.ts b/tests/testdata/bench/collect/include/2_bench.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/bench/collect/include/bench.ts b/tests/testdata/bench/collect/include/bench.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/bench/collect2.out b/tests/testdata/bench/collect2.out deleted file mode 100644 index 00b8bfc0d..000000000 --- a/tests/testdata/bench/collect2.out +++ /dev/null @@ -1,13 +0,0 @@ -Check [WILDCARD]/bench/collect/bench.ts -Check [WILDCARD]/bench/collect/include/bench.ts -cpu: [WILDCARD] -runtime: deno [WILDCARD] ([WILDCARD]) - -[WILDCARD]/bench/collect/bench.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ---------------------------------------------------------------- ----------------------------- - -[WILDCARD]/bench/collect/include/bench.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ---------------------------------------------------------------- ----------------------------- - diff --git a/tests/testdata/bench/collect_with_malformed_config.out b/tests/testdata/bench/collect_with_malformed_config.out deleted file mode 100644 index 92e5e29d2..000000000 --- a/tests/testdata/bench/collect_with_malformed_config.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Failed to parse "bench" configuration - -Caused by: - unknown field `dont_know_this_field`, expected one of `include`, `exclude`, `files` diff --git a/tests/testdata/bench/exit_sanitizer.ts b/tests/testdata/bench/exit_sanitizer.ts deleted file mode 100644 index 8e596b310..000000000 --- a/tests/testdata/bench/exit_sanitizer.ts +++ /dev/null @@ -1,11 +0,0 @@ -Deno.bench("exit(0)", function () { - Deno.exit(0); -}); - -Deno.bench("exit(1)", function () { - Deno.exit(1); -}); - -Deno.bench("exit(2)", function () { - Deno.exit(2); -}); diff --git a/tests/testdata/bench/explicit_start_and_end.ts b/tests/testdata/bench/explicit_start_and_end.ts deleted file mode 100644 index 60a3d10d7..000000000 --- a/tests/testdata/bench/explicit_start_and_end.ts +++ /dev/null @@ -1,50 +0,0 @@ -Deno.bench("start and end", (t) => { - const id = setInterval(() => {}, 1000); - t.start(); - Deno.inspect(id); - t.end(); - clearInterval(id); -}); - -Deno.bench("start only", (t) => { - const id = setInterval(() => {}, 1000); - t.start(); - Deno.inspect(id); - clearInterval(id); -}); - -Deno.bench("end only", (t) => { - const id = setInterval(() => {}, 1000); - Deno.inspect(id); - t.end(); - clearInterval(id); -}); - -Deno.bench("double start", (t) => { - const id = setInterval(() => {}, 1000); - t.start(); - t.start(); - Deno.inspect(id); - t.end(); - clearInterval(id); -}); - -let captured: Deno.BenchContext; - -Deno.bench("double end", (t) => { - captured = t; - const id = setInterval(() => {}, 1000); - t.start(); - Deno.inspect(id); - t.end(); - t.end(); - clearInterval(id); -}); - -Deno.bench("captured", () => { - const id = setInterval(() => {}, 1000); - captured!.start(); - Deno.inspect(id); - captured!.end(); - clearInterval(id); -}); diff --git a/tests/testdata/bench/explicit_start_and_end_low_precision.out b/tests/testdata/bench/explicit_start_and_end_low_precision.out deleted file mode 100644 index 6dc66cfcc..000000000 --- a/tests/testdata/bench/explicit_start_and_end_low_precision.out +++ /dev/null @@ -1,10 +0,0 @@ -cpu: [WILDCARD] -runtime: deno [WILDCARD] ([WILDCARD]) - -[WILDCARD]/explicit_start_and_end_low_precision.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ------------------------------------------------------------------------------ ----------------------------- -noop with start and end [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] -Warning: start() and end() calls in "noop with start and end" are ignored because it averages less -than 10µs per iteration. Remove them for better results. - diff --git a/tests/testdata/bench/explicit_start_and_end_low_precision.ts b/tests/testdata/bench/explicit_start_and_end_low_precision.ts deleted file mode 100644 index 23bdf19fe..000000000 --- a/tests/testdata/bench/explicit_start_and_end_low_precision.ts +++ /dev/null @@ -1,4 +0,0 @@ -Deno.bench("noop with start and end", (b) => { - b.start(); - b.end(); -}); diff --git a/tests/testdata/bench/fail.ts b/tests/testdata/bench/fail.ts deleted file mode 100644 index 33d70ce55..000000000 --- a/tests/testdata/bench/fail.ts +++ /dev/null @@ -1,30 +0,0 @@ -Deno.bench("bench0", () => { - throw new Error(); -}); -Deno.bench("bench1", () => { - throw new Error(); -}); -Deno.bench("bench2", () => { - throw new Error(); -}); -Deno.bench("bench3", () => { - throw new Error(); -}); -Deno.bench("bench4", () => { - throw new Error(); -}); -Deno.bench("bench5", () => { - throw new Error(); -}); -Deno.bench("bench6", () => { - throw new Error(); -}); -Deno.bench("bench7", () => { - throw new Error(); -}); -Deno.bench("bench8", () => { - throw new Error(); -}); -Deno.bench("bench9", () => { - throw new Error(); -}); diff --git a/tests/testdata/bench/filter.out b/tests/testdata/bench/filter.out deleted file mode 100644 index 970171e0b..000000000 --- a/tests/testdata/bench/filter.out +++ /dev/null @@ -1,20 +0,0 @@ -Check [WILDCARD]/bench/filter/a_bench.ts -Check [WILDCARD]/bench/filter/b_bench.ts -Check [WILDCARD]/bench/filter/c_bench.ts -cpu: [WILDCARD] -runtime: deno [WILDCARD] ([WILDCARD]) - -[WILDCARD]/bench/filter/a_bench.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ---------------------------------------------------------------- ----------------------------- -foo [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] - -[WILDCARD]/bench/filter/b_bench.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ---------------------------------------------------------------- ----------------------------- -foo [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] - -[WILDCARD]/bench/filter/c_bench.ts -benchmark time (avg) iter/s (min … max) p75 p99 p995 ---------------------------------------------------------------- ----------------------------- -foo [WILDCARD] [WILDCARD]/iter[WILDCARD]([WILDCARD] … [WILDCARD]) [WILDCARD] diff --git a/tests/testdata/bench/filter/a_bench.ts b/tests/testdata/bench/filter/a_bench.ts deleted file mode 100644 index fc4ef859c..000000000 --- a/tests/testdata/bench/filter/a_bench.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.bench("foo", function () {}); -Deno.bench("bar", function () {}); -Deno.bench("baz", function () {}); diff --git a/tests/testdata/bench/filter/b_bench.ts b/tests/testdata/bench/filter/b_bench.ts deleted file mode 100644 index fc4ef859c..000000000 --- a/tests/testdata/bench/filter/b_bench.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.bench("foo", function () {}); -Deno.bench("bar", function () {}); -Deno.bench("baz", function () {}); diff --git a/tests/testdata/bench/filter/c_bench.ts b/tests/testdata/bench/filter/c_bench.ts deleted file mode 100644 index fc4ef859c..000000000 --- a/tests/testdata/bench/filter/c_bench.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.bench("foo", function () {}); -Deno.bench("bar", function () {}); -Deno.bench("baz", function () {}); diff --git a/tests/testdata/bench/finally_timeout.ts b/tests/testdata/bench/finally_timeout.ts deleted file mode 100644 index c49eb8da2..000000000 --- a/tests/testdata/bench/finally_timeout.ts +++ /dev/null @@ -1,11 +0,0 @@ -Deno.bench("error", function () { - const timer = setTimeout(() => null, 10000); - try { - throw new Error("fail"); - } finally { - clearTimeout(timer); - } -}); - -Deno.bench("success", function () { -}); diff --git a/tests/testdata/bench/group_baseline.ts b/tests/testdata/bench/group_baseline.ts deleted file mode 100644 index a86f6455c..000000000 --- a/tests/testdata/bench/group_baseline.ts +++ /dev/null @@ -1,15 +0,0 @@ -Deno.bench("noop", () => {}); -Deno.bench("noop2", { baseline: true }, () => {}); - -Deno.bench("noop3", { group: "url" }, () => {}); - -Deno.bench("parse url 2x", { group: "url", baseline: true }, () => { - new URL("https://deno.land/std/http/server.ts"); - new URL("https://deno.land/std/http/server.ts"); -}); - -Deno.bench("parse url 200x", { group: "url" }, () => { - for (let i = 0; i < 200; i++) { - new URL("https://deno.land/std/http/server.ts"); - } -}); diff --git a/tests/testdata/bench/ignore.ts b/tests/testdata/bench/ignore.ts deleted file mode 100644 index 0226fe76f..000000000 --- a/tests/testdata/bench/ignore.ts +++ /dev/null @@ -1,9 +0,0 @@ -for (let i = 0; i < 10; i++) { - Deno.bench({ - name: `bench${i}`, - ignore: true, - fn() { - throw new Error("unreachable"); - }, - }); -} diff --git a/tests/testdata/bench/ignore_permissions.ts b/tests/testdata/bench/ignore_permissions.ts deleted file mode 100644 index 0dcd9299f..000000000 --- a/tests/testdata/bench/ignore_permissions.ts +++ /dev/null @@ -1,16 +0,0 @@ -Deno.bench({ - name: "ignore", - permissions: { - read: true, - write: true, - net: true, - env: true, - run: true, - ffi: true, - hrtime: true, - }, - ignore: true, - fn() { - throw new Error("unreachable"); - }, -}); diff --git a/tests/testdata/bench/interval.ts b/tests/testdata/bench/interval.ts deleted file mode 100644 index 7eb588c59..000000000 --- a/tests/testdata/bench/interval.ts +++ /dev/null @@ -1 +0,0 @@ -setInterval(function () {}, 0); diff --git a/tests/testdata/bench/load_unload.ts b/tests/testdata/bench/load_unload.ts deleted file mode 100644 index 3653c135d..000000000 --- a/tests/testdata/bench/load_unload.ts +++ /dev/null @@ -1,22 +0,0 @@ -let interval: number | null = null; -addEventListener("load", () => { - if (interval) { - throw new Error("Interval is already set"); - } - - interval = setInterval(() => {}, 0); -}); - -addEventListener("unload", () => { - if (!interval) { - throw new Error("Interval was not set"); - } - - clearInterval(interval); -}); - -Deno.bench("bench", () => { - if (!interval) { - throw new Error("Interval was not set"); - } -}); diff --git a/tests/testdata/bench/meta.ts b/tests/testdata/bench/meta.ts deleted file mode 100644 index e32fdeea6..000000000 --- a/tests/testdata/bench/meta.ts +++ /dev/null @@ -1,2 +0,0 @@ -console.log("import.meta.main: %s", import.meta.main); -console.log("import.meta.url: %s", import.meta.url); diff --git a/tests/testdata/bench/multiple_group.ts b/tests/testdata/bench/multiple_group.ts deleted file mode 100644 index 165b5e201..000000000 --- a/tests/testdata/bench/multiple_group.ts +++ /dev/null @@ -1,15 +0,0 @@ -Deno.bench("noop", { group: "noop" }, () => {}); -Deno.bench("noop2", { group: "noop", baseline: true }, () => {}); - -Deno.bench("noop3", { group: "url" }, () => {}); - -Deno.bench("parse url 2x", { group: "url", baseline: true }, () => { - new URL("https://jsr.io/@std/http/0.221.0/file_server.ts"); - new URL("https://jsr.io/@std/http/0.221.0/file_server.ts"); -}); - -Deno.bench("parse url 200x", { group: "url" }, () => { - for (let i = 0; i < 200; i++) { - new URL("https://jsr.io/@std/http/0.221.0/file_server.ts"); - } -}); diff --git a/tests/testdata/bench/no_check.ts b/tests/testdata/bench/no_check.ts deleted file mode 100644 index b159cabd6..000000000 --- a/tests/testdata/bench/no_check.ts +++ /dev/null @@ -1 +0,0 @@ -Deno.bench(); diff --git a/tests/testdata/bench/no_prompt_by_default.ts b/tests/testdata/bench/no_prompt_by_default.ts deleted file mode 100644 index 59359eebd..000000000 --- a/tests/testdata/bench/no_prompt_by_default.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.bench("no prompt", async () => { - await Deno.readTextFile("./some_file.txt"); -}); diff --git a/tests/testdata/bench/no_prompt_with_denied_perms.ts b/tests/testdata/bench/no_prompt_with_denied_perms.ts deleted file mode 100644 index 2f0d63bbe..000000000 --- a/tests/testdata/bench/no_prompt_with_denied_perms.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.bench("no prompt", { permissions: { read: false } }, async () => { - await Deno.readTextFile("./some_file.txt"); -}); diff --git a/tests/testdata/bench/no_run.ts b/tests/testdata/bench/no_run.ts deleted file mode 100644 index c7a5dc1e8..000000000 --- a/tests/testdata/bench/no_run.ts +++ /dev/null @@ -1,2 +0,0 @@ -const _value: string = 1; -console.log("this should not be run"); diff --git a/tests/testdata/bench/only.ts b/tests/testdata/bench/only.ts deleted file mode 100644 index 0129c024c..000000000 --- a/tests/testdata/bench/only.ts +++ /dev/null @@ -1,15 +0,0 @@ -Deno.bench({ - name: "before", - fn() {}, -}); - -Deno.bench({ - only: true, - name: "only", - fn() {}, -}); - -Deno.bench({ - name: "after", - fn() {}, -}); diff --git a/tests/testdata/bench/overloads.ts b/tests/testdata/bench/overloads.ts deleted file mode 100644 index 4f5887f79..000000000 --- a/tests/testdata/bench/overloads.ts +++ /dev/null @@ -1,6 +0,0 @@ -Deno.bench("bench0", () => {}); -Deno.bench(function bench1() {}); -Deno.bench({ name: "bench2", fn: () => {} }); -Deno.bench("bench3", { permissions: "none" }, () => {}); -Deno.bench({ name: "bench4" }, () => {}); -Deno.bench({ ignore: true }, function bench5() {}); diff --git a/tests/testdata/bench/pass.ts b/tests/testdata/bench/pass.ts deleted file mode 100644 index 48348d447..000000000 --- a/tests/testdata/bench/pass.ts +++ /dev/null @@ -1,10 +0,0 @@ -Deno.bench("bench0", () => {}); -Deno.bench("bench1", () => {}); -Deno.bench("bench2", () => {}); -Deno.bench("bench3", () => {}); -Deno.bench("bench4", () => {}); -Deno.bench("bench5", () => {}); -Deno.bench("bench6", () => {}); -Deno.bench("bench7", () => {}); -Deno.bench("bench8", () => {}); -Deno.bench("bench9", () => {}); diff --git a/tests/testdata/bench/quiet.ts b/tests/testdata/bench/quiet.ts deleted file mode 100644 index efeb366ff..000000000 --- a/tests/testdata/bench/quiet.ts +++ /dev/null @@ -1,15 +0,0 @@ -Deno.bench("console.log", function () { - console.log("log"); -}); - -Deno.bench("console.error", function () { - console.error("error"); -}); - -Deno.bench("console.info", function () { - console.info("info"); -}); - -Deno.bench("console.warn", function () { - console.info("warn"); -}); diff --git a/tests/testdata/bench/unhandled_rejection.ts b/tests/testdata/bench/unhandled_rejection.ts deleted file mode 100644 index 32f3111ea..000000000 --- a/tests/testdata/bench/unhandled_rejection.ts +++ /dev/null @@ -1,3 +0,0 @@ -new Promise((_resolve, reject) => { - reject(new Error("rejection")); -}); diff --git a/tests/testdata/bench/unresolved_promise.ts b/tests/testdata/bench/unresolved_promise.ts deleted file mode 100644 index 25fe70762..000000000 --- a/tests/testdata/bench/unresolved_promise.ts +++ /dev/null @@ -1 +0,0 @@ -await new Promise((_resolve, _reject) => {}); diff --git a/tests/testdata/cache/095_cache_with_bare_import.ts b/tests/testdata/cache/095_cache_with_bare_import.ts deleted file mode 100644 index c0748305d..000000000 --- a/tests/testdata/cache/095_cache_with_bare_import.ts +++ /dev/null @@ -1 +0,0 @@ -import "foo"; diff --git a/tests/testdata/cache/cache_extensionless.out b/tests/testdata/cache/cache_extensionless.out deleted file mode 100644 index 3694c67cb..000000000 --- a/tests/testdata/cache/cache_extensionless.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -Check http://localhost:4545/subdir/no_js_ext diff --git a/tests/testdata/cache/cache_random_extension.out b/tests/testdata/cache/cache_random_extension.out deleted file mode 100644 index 745a2e0e3..000000000 --- a/tests/testdata/cache/cache_random_extension.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -Check http://localhost:4545/subdir/no_js_ext@1.0.0 diff --git a/tests/testdata/cache/check_local_by_default.ts b/tests/testdata/cache/check_local_by_default.ts deleted file mode 100644 index 2ae8c2692..000000000 --- a/tests/testdata/cache/check_local_by_default.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/cache/check_local_by_default2.ts b/tests/testdata/cache/check_local_by_default2.ts deleted file mode 100644 index 5177ff944..000000000 --- a/tests/testdata/cache/check_local_by_default2.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/cache/ignore_require.js b/tests/testdata/cache/ignore_require.js deleted file mode 100644 index a8ef15021..000000000 --- a/tests/testdata/cache/ignore_require.js +++ /dev/null @@ -1,2 +0,0 @@ -// deno-lint-ignore-file -require("invalid module specifier"); diff --git a/tests/testdata/cache/json_import/main.ts b/tests/testdata/cache/json_import/main.ts deleted file mode 100644 index 78273558f..000000000 --- a/tests/testdata/cache/json_import/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import asdf from "./test.json" assert { type: "json" }; -console.log(asdf); diff --git a/tests/testdata/cache/json_import/test.json b/tests/testdata/cache/json_import/test.json deleted file mode 100644 index 258849a68..000000000 --- a/tests/testdata/cache/json_import/test.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": { - "bar": 1 - } -} diff --git a/tests/testdata/cache/redirect_cache.out b/tests/testdata/cache/redirect_cache.out deleted file mode 100644 index 8905c4529..000000000 --- a/tests/testdata/cache/redirect_cache.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://localhost:4548/subdir/redirects/a.ts -Download http://localhost:4546/subdir/redirects/a.ts -Download http://localhost:4545/subdir/redirects/a.ts -Download http://localhost:4545/subdir/redirects/b.ts -Check http://localhost:4548/subdir/redirects/a.ts diff --git a/tests/testdata/check/excluded_file_specified/check.out b/tests/testdata/check/excluded_file_specified/check.out deleted file mode 100644 index 2bc26aaaf..000000000 --- a/tests/testdata/check/excluded_file_specified/check.out +++ /dev/null @@ -1 +0,0 @@ -Warning No matching files found. diff --git a/tests/testdata/check/excluded_file_specified/deno.json b/tests/testdata/check/excluded_file_specified/deno.json deleted file mode 100644 index 039be18df..000000000 --- a/tests/testdata/check/excluded_file_specified/deno.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "types": ["./lib/types.d.ts"] - }, - "exclude": ["lib"] -} diff --git a/tests/testdata/check/excluded_file_specified/lib/types.d.ts b/tests/testdata/check/excluded_file_specified/lib/types.d.ts deleted file mode 100644 index a02ad0cbe..000000000 --- a/tests/testdata/check/excluded_file_specified/lib/types.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// deno-lint-ignore-file -declare var test: number; diff --git a/tests/testdata/check/types_dts/deno.json b/tests/testdata/check/types_dts/deno.json deleted file mode 100644 index 85f1549e0..000000000 --- a/tests/testdata/check/types_dts/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "./types.d.ts" - ] - } -} diff --git a/tests/testdata/check/types_dts/main.out b/tests/testdata/check/types_dts/main.out deleted file mode 100644 index c769989e3..000000000 --- a/tests/testdata/check/types_dts/main.out +++ /dev/null @@ -1 +0,0 @@ -Check file:///[WILDCARD]/check/types_dts/main.ts diff --git a/tests/testdata/check/types_dts/main.ts b/tests/testdata/check/types_dts/main.ts deleted file mode 100644 index ca375a094..000000000 --- a/tests/testdata/check/types_dts/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log("Hello world!"); - -test.test(); diff --git a/tests/testdata/check/types_dts/types.d.ts b/tests/testdata/check/types_dts/types.d.ts deleted file mode 100644 index 141c2a3d3..000000000 --- a/tests/testdata/check/types_dts/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare class test { - static test(): void; -} diff --git a/tests/testdata/lint/no_slow_types/a.ts b/tests/testdata/lint/no_slow_types/a.ts deleted file mode 100644 index 3b399665d..000000000 --- a/tests/testdata/lint/no_slow_types/a.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function add(a: number, b: number) { - return a + b; -} diff --git a/tests/testdata/lint/no_slow_types/b.ts b/tests/testdata/lint/no_slow_types/b.ts deleted file mode 100644 index b96a79489..000000000 --- a/tests/testdata/lint/no_slow_types/b.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function addB(a: number, b: number) { - return a + b; -} - -export * from "./d.ts"; diff --git a/tests/testdata/lint/no_slow_types/c.ts b/tests/testdata/lint/no_slow_types/c.ts deleted file mode 100644 index 517aa3d21..000000000 --- a/tests/testdata/lint/no_slow_types/c.ts +++ /dev/null @@ -1,4 +0,0 @@ -// this one won't error because it's not an export -export function addC(a: number, b: number) { - return a + b; -} diff --git a/tests/testdata/lint/no_slow_types/d.ts b/tests/testdata/lint/no_slow_types/d.ts deleted file mode 100644 index babe9d81b..000000000 --- a/tests/testdata/lint/no_slow_types/d.ts +++ /dev/null @@ -1,4 +0,0 @@ -// this one is re-exported via b.ts -export function addD(a: number, b: number) { - return a + b; -} diff --git a/tests/testdata/lint/no_slow_types/deno.json b/tests/testdata/lint/no_slow_types/deno.json deleted file mode 100644 index 2fd0af5f0..000000000 --- a/tests/testdata/lint/no_slow_types/deno.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@pkg/pkg", - "version": "1.0.0", - "exports": { - "./a": "./a.ts", - "./b": "./b.ts" - } -} diff --git a/tests/testdata/lint/no_slow_types/deno.non-package.json b/tests/testdata/lint/no_slow_types/deno.non-package.json deleted file mode 100644 index 2c63c0851..000000000 --- a/tests/testdata/lint/no_slow_types/deno.non-package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/tests/testdata/lint/no_slow_types/no_slow_types.out b/tests/testdata/lint/no_slow_types/no_slow_types.out deleted file mode 100644 index 5828906e7..000000000 --- a/tests/testdata/lint/no_slow_types/no_slow_types.out +++ /dev/null @@ -1,35 +0,0 @@ -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]a.ts:1:17 - | -1 | export function add(a: number, b: number) { - | ^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]b.ts:1:17 - | -1 | export function addB(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]d.ts:2:17 - | -2 | export function addD(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -Found 3 problems -Checked 4 files diff --git a/tests/testdata/lint/no_slow_types/no_slow_types_entrypoint.out b/tests/testdata/lint/no_slow_types/no_slow_types_entrypoint.out deleted file mode 100644 index b8c1013bf..000000000 --- a/tests/testdata/lint/no_slow_types/no_slow_types_entrypoint.out +++ /dev/null @@ -1,35 +0,0 @@ -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]a.ts:1:17 - | -1 | export function add(a: number, b: number) { - | ^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]b.ts:1:17 - | -1 | export function addB(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]d.ts:2:17 - | -2 | export function addD(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -Found 3 problems -Checked 1 file diff --git a/tests/testdata/lint/no_slow_types_workspace/a/b.ts b/tests/testdata/lint/no_slow_types_workspace/a/b.ts deleted file mode 100644 index b96a79489..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/a/b.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function addB(a: number, b: number) { - return a + b; -} - -export * from "./d.ts"; diff --git a/tests/testdata/lint/no_slow_types_workspace/a/d.ts b/tests/testdata/lint/no_slow_types_workspace/a/d.ts deleted file mode 100644 index babe9d81b..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/a/d.ts +++ /dev/null @@ -1,4 +0,0 @@ -// this one is re-exported via b.ts -export function addD(a: number, b: number) { - return a + b; -} diff --git a/tests/testdata/lint/no_slow_types_workspace/a/deno.json b/tests/testdata/lint/no_slow_types_workspace/a/deno.json deleted file mode 100644 index 5a971cd85..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/a/deno.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@pkg/a", - "version": "1.0.0", - "exports": { - "./a": "./mod.ts", - "./b": "./b.ts" - } -} diff --git a/tests/testdata/lint/no_slow_types_workspace/a/mod.ts b/tests/testdata/lint/no_slow_types_workspace/a/mod.ts deleted file mode 100644 index 3b399665d..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/a/mod.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function add(a: number, b: number) { - return a + b; -} diff --git a/tests/testdata/lint/no_slow_types_workspace/b/deno.json b/tests/testdata/lint/no_slow_types_workspace/b/deno.json deleted file mode 100644 index c95aeb029..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/b/deno.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@pkg/b", - "version": "1.0.0", - "exports": "./mod.ts" -} diff --git a/tests/testdata/lint/no_slow_types_workspace/b/mod.ts b/tests/testdata/lint/no_slow_types_workspace/b/mod.ts deleted file mode 100644 index fa1c068de..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/b/mod.ts +++ /dev/null @@ -1,4 +0,0 @@ -// ok -export function addB(a: number, b: number): number { - return a + b; -} diff --git a/tests/testdata/lint/no_slow_types_workspace/c/deno.json b/tests/testdata/lint/no_slow_types_workspace/c/deno.json deleted file mode 100644 index 36d6e2e67..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/c/deno.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@pkg/c", - "version": "1.0.0", - "exports": "./mod_c.ts" -} diff --git a/tests/testdata/lint/no_slow_types_workspace/c/mod_c.ts b/tests/testdata/lint/no_slow_types_workspace/c/mod_c.ts deleted file mode 100644 index 632a90b65..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/c/mod_c.ts +++ /dev/null @@ -1,4 +0,0 @@ -// not ok -export function addC(a: number, b: number) { - return a + b; -} diff --git a/tests/testdata/lint/no_slow_types_workspace/deno.json b/tests/testdata/lint/no_slow_types_workspace/deno.json deleted file mode 100644 index e3dd981e5..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "workspaces": [ - "./a", - "./b", - "./c" - ] -} diff --git a/tests/testdata/lint/no_slow_types_workspace/output.out b/tests/testdata/lint/no_slow_types_workspace/output.out deleted file mode 100644 index 05f54099b..000000000 --- a/tests/testdata/lint/no_slow_types_workspace/output.out +++ /dev/null @@ -1,46 +0,0 @@ -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]b.ts:1:17 - | -1 | export function addB(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]d.ts:2:17 - | -2 | export function addD(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]mod.ts:1:17 - | -1 | export function add(a: number, b: number) { - | ^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]mod_c.ts:2:17 - | -2 | export function addC(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -Found 4 problems -Checked 5 files diff --git a/tests/testdata/lockfile/basic/bench.nolock.out b/tests/testdata/lockfile/basic/bench.nolock.out deleted file mode 100644 index 83e4de242..000000000 --- a/tests/testdata/lockfile/basic/bench.nolock.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4545/lockfile/basic/mod.ts -Check file:///[WILDCARD]/main.bench.ts -cpu: [WILDCARD] -runtime: [WILDCARD] - -[WILDCARD] diff --git a/tests/testdata/lockfile/basic/deno.json b/tests/testdata/lockfile/basic/deno.json deleted file mode 100644 index d6541b78e..000000000 --- a/tests/testdata/lockfile/basic/deno.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "mod": "http://localhost:4545/lockfile/basic/mod.ts" - } -} diff --git a/tests/testdata/lockfile/basic/deno.lock b/tests/testdata/lockfile/basic/deno.lock deleted file mode 100644 index 42ab94f9b..000000000 --- a/tests/testdata/lockfile/basic/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/lockfile/basic/mod.ts": "invalid" - } -} diff --git a/tests/testdata/lockfile/basic/doc.nolock.out b/tests/testdata/lockfile/basic/doc.nolock.out deleted file mode 100644 index e2d66c027..000000000 --- a/tests/testdata/lockfile/basic/doc.nolock.out +++ /dev/null @@ -1 +0,0 @@ -Download http://localhost:4545/lockfile/basic/mod.ts diff --git a/tests/testdata/lockfile/basic/fail.out b/tests/testdata/lockfile/basic/fail.out deleted file mode 100644 index 6a808c0a5..000000000 --- a/tests/testdata/lockfile/basic/fail.out +++ /dev/null @@ -1,4 +0,0 @@ -Download http://localhost:4545/lockfile/basic/mod.ts -error: The source code is invalid, as it does not match the expected hash in the lock file. - Specifier: [WILDCARD]mod.ts - Lock file: [WILDCARD]deno.lock diff --git a/tests/testdata/lockfile/basic/info.nolock.out b/tests/testdata/lockfile/basic/info.nolock.out deleted file mode 100644 index d1ef82e49..000000000 --- a/tests/testdata/lockfile/basic/info.nolock.out +++ /dev/null @@ -1,8 +0,0 @@ -Download http://localhost:4545/lockfile/basic/mod.ts -local: [WILDCARD]main.ts -type: TypeScript -dependencies: 1 unique -size: [WILDCARD] - -file:///[WILDCARD]/main.ts ([WILDCARD]) -└── http://localhost:4545/lockfile/basic/mod.ts ([WILDCARD]) diff --git a/tests/testdata/lockfile/basic/main.bench.ts b/tests/testdata/lockfile/basic/main.bench.ts deleted file mode 100644 index 918adde2f..000000000 --- a/tests/testdata/lockfile/basic/main.bench.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { getValue } from "mod"; - -Deno.bench("bench", () => { - const testing = 1 + getValue(); - if (testing !== 6) { - throw "FAIL"; - } -}); diff --git a/tests/testdata/lockfile/basic/main.test.ts b/tests/testdata/lockfile/basic/main.test.ts deleted file mode 100644 index fe45c799d..000000000 --- a/tests/testdata/lockfile/basic/main.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { getValue } from "mod"; - -Deno.test("test", () => { - const testing = 1 + getValue(); - if (testing !== 6) { - throw "FAIL"; - } -}); diff --git a/tests/testdata/lockfile/basic/main.ts b/tests/testdata/lockfile/basic/main.ts deleted file mode 100644 index 8d07c8153..000000000 --- a/tests/testdata/lockfile/basic/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { getValue } from "mod"; - -console.log(getValue()); diff --git a/tests/testdata/lockfile/basic/test.nolock.out b/tests/testdata/lockfile/basic/test.nolock.out deleted file mode 100644 index 1332dfa8f..000000000 --- a/tests/testdata/lockfile/basic/test.nolock.out +++ /dev/null @@ -1,4 +0,0 @@ -Download http://localhost:4545/lockfile/basic/mod.ts -Check file:///[WILDCARD]/main.test.ts -running 1 test from [WILDCARD]/main.test.ts -[WILDCARD] diff --git a/tests/testdata/package_json/basic/lib.bench.out b/tests/testdata/package_json/basic/lib.bench.out deleted file mode 100644 index fa9c5efc6..000000000 --- a/tests/testdata/package_json/basic/lib.bench.out +++ /dev/null @@ -1,11 +0,0 @@ -Download http://localhost:4545/npm/registry/@denotest/esm-basic -Download http://localhost:4545/npm/registry/@denotest/esm-basic/1.0.0.tgz -Initialize @denotest/esm-basic@1.0.0 -Check file:///[WILDCARD]/lib.bench.ts -cpu: [WILDCARD] -runtime: [WILDCARD] - -file:///[WILDCARD]/lib.bench.ts -[WILDCARD] ----------------------------------------------------------------- ----------------------------- -should add [WILDCARD] diff --git a/tests/testdata/package_json/basic/lib.bench.ts b/tests/testdata/package_json/basic/lib.bench.ts deleted file mode 100644 index e6b79d025..000000000 --- a/tests/testdata/package_json/basic/lib.bench.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { add } from "./lib.ts"; - -Deno.bench("should add", () => { - if (add(1, 2) !== 3) { - throw new Error("Fail"); - } -}); diff --git a/tests/testdata/package_json/basic/main.cache.out b/tests/testdata/package_json/basic/main.cache.out deleted file mode 100644 index 1c729e2a3..000000000 --- a/tests/testdata/package_json/basic/main.cache.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4545/npm/registry/@denotest/esm-basic -Download http://localhost:4545/npm/registry/@denotest/esm-basic/1.0.0.tgz -Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/testdata/publish/allow_slow_types.out b/tests/testdata/publish/allow_slow_types.out deleted file mode 100644 index cd22c0ce7..000000000 --- a/tests/testdata/publish/allow_slow_types.out +++ /dev/null @@ -1,5 +0,0 @@ -Check file:///[WILDCARD]mod.ts -Warning Publishing a library with slow types is not recommended. This may lead to poor type checking performance for users of your package, may affect the quality of automatic documentation generation, and your package will not be shipped with a .d.ts file for Node.js users. -Publishing @foo/bar@1.1.0 ... -Successfully published @foo/bar@1.1.0 -Visit http://127.0.0.1:4250/@foo/bar@1.1.0 for details diff --git a/tests/testdata/publish/bare_node_builtins.out b/tests/testdata/publish/bare_node_builtins.out deleted file mode 100644 index c2cf2e2af..000000000 --- a/tests/testdata/publish/bare_node_builtins.out +++ /dev/null @@ -1,11 +0,0 @@ -Warning: Resolving "url" as "node:url" at file:///[WILDCARD]/publish/bare_node_builtins/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix. -Warning: Resolving "url" as "node:url" at file:///[WILDCARD]/publish/bare_node_builtins/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix. -Download http://localhost:4545/npm/registry/@types/node -Download http://localhost:4545/npm/registry/@types/node/node-18.16.19.tgz -Check file:///[WILDCARD]/publish/bare_node_builtins/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/bare_node_builtins/mod.ts -Simulating publish of @foo/bar@1.0.0 with files: - file:///[WILDCARD]/publish/bare_node_builtins/deno.json (87B) - file:///[WILDCARD]/publish/bare_node_builtins/mod.ts (121B) -Warning Aborting due to --dry-run diff --git a/tests/testdata/publish/bare_node_builtins/deno.json b/tests/testdata/publish/bare_node_builtins/deno.json deleted file mode 100644 index 213a7cec6..000000000 --- a/tests/testdata/publish/bare_node_builtins/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/bare_node_builtins/mod.ts b/tests/testdata/publish/bare_node_builtins/mod.ts deleted file mode 100644 index 04374d8b7..000000000 --- a/tests/testdata/publish/bare_node_builtins/mod.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as url from "url"; - -export function foobar(): { href: string } { - return url.pathToFileURL("/foo/bar"); -} diff --git a/tests/testdata/publish/bare_node_builtins_no_warnings.out b/tests/testdata/publish/bare_node_builtins_no_warnings.out deleted file mode 100644 index d8d43eff6..000000000 --- a/tests/testdata/publish/bare_node_builtins_no_warnings.out +++ /dev/null @@ -1,9 +0,0 @@ -Download http://localhost:4545/npm/registry/@types/node -Download http://localhost:4545/npm/registry/@types/node/node-18.16.19.tgz -Check file:///[WILDCARD]/publish/bare_node_builtins/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/bare_node_builtins/mod.ts -Simulating publish of @foo/bar@1.0.0 with files: - file:///[WILDCARD]/publish/bare_node_builtins/deno.json (87B) - file:///[WILDCARD]/publish/bare_node_builtins/mod.ts (121B) -Warning Aborting due to --dry-run diff --git a/tests/testdata/publish/deno_jsonc.out b/tests/testdata/publish/deno_jsonc.out deleted file mode 100644 index 820554943..000000000 --- a/tests/testdata/publish/deno_jsonc.out +++ /dev/null @@ -1,6 +0,0 @@ -Check file:///[WILDCARD]/publish/deno_jsonc/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/deno_jsonc/mod.ts -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/deno_jsonc/deno.jsonc b/tests/testdata/publish/deno_jsonc/deno.jsonc deleted file mode 100644 index 4c9dfb08c..000000000 --- a/tests/testdata/publish/deno_jsonc/deno.jsonc +++ /dev/null @@ -1,11 +0,0 @@ -{ - // It's .jsonc file so it can have comments - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - }, - "imports": { - "@std/http": "./std_http.ts" - } -} diff --git a/tests/testdata/publish/deno_jsonc/mod.ts b/tests/testdata/publish/deno_jsonc/mod.ts deleted file mode 100644 index 6e8a61bae..000000000 --- a/tests/testdata/publish/deno_jsonc/mod.ts +++ /dev/null @@ -1,7 +0,0 @@ -import http from "@std/http"; - -export function foobar(): { fileServer(): void } { - return { - fileServer: http.fileServer, - }; -} diff --git a/tests/testdata/publish/deno_jsonc/std_http.ts b/tests/testdata/publish/deno_jsonc/std_http.ts deleted file mode 100644 index 9d57b36f3..000000000 --- a/tests/testdata/publish/deno_jsonc/std_http.ts +++ /dev/null @@ -1,6 +0,0 @@ -// temp until we get jsr:@std/http in the test server -export default { - fileServer() { - console.log("Hi"); - }, -}; diff --git a/tests/testdata/publish/dry_run.out b/tests/testdata/publish/dry_run.out deleted file mode 100644 index afc2ba66a..000000000 --- a/tests/testdata/publish/dry_run.out +++ /dev/null @@ -1,8 +0,0 @@ -Check file:///[WILDCARD]/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/mod.ts -Simulating publish of @foo/bar@1.0.0 with files: - [WILDCARD]deno.json (140B) - [WILDCARD]mod.ts (137B) - [WILDCARD]std_http.ts (119B) -Warning Aborting due to --dry-run diff --git a/tests/testdata/publish/has_slow_types.out b/tests/testdata/publish/has_slow_types.out deleted file mode 100644 index 43ac86658..000000000 --- a/tests/testdata/publish/has_slow_types.out +++ /dev/null @@ -1,22 +0,0 @@ -Check file:///[WILDCARD]/mod.ts -Checking for slow types in the public API... -error[missing-explicit-return-type]: missing explicit return type in the public API - --> [WILDCARD]mod.ts:2:17 - | -2 | export function getRandom() { - | ^^^^^^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - -This package contains errors for slow types. Fixing these errors will: - - 1. Significantly improve your package users' type checking performance. - 2. Improve the automatic documentation generation. - 3. Enable automatic .d.ts generation for Node.js. - -Don't want to bother? You can choose to skip this step by -providing the --allow-slow-types flag. - -error: Found 1 problem diff --git a/tests/testdata/publish/has_slow_types/deno.json b/tests/testdata/publish/has_slow_types/deno.json deleted file mode 100644 index 5826e5529..000000000 --- a/tests/testdata/publish/has_slow_types/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.1.0", - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/has_slow_types/mod.ts b/tests/testdata/publish/has_slow_types/mod.ts deleted file mode 100644 index 025311049..000000000 --- a/tests/testdata/publish/has_slow_types/mod.ts +++ /dev/null @@ -1,4 +0,0 @@ -// requires an explicit type annotation of `number` -export function getRandom() { - return Math.random(); -} diff --git a/tests/testdata/publish/invalid_import.out b/tests/testdata/publish/invalid_import.out deleted file mode 100644 index f6742de95..000000000 --- a/tests/testdata/publish/invalid_import.out +++ /dev/null @@ -1,32 +0,0 @@ -Download http://localhost:4545/welcome.ts -Download http://localhost:4545/echo.ts -Download http://localhost:4545/npm/registry/chalk -Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz -Check file:///[WILDCARD]/mod.ts -Checking for slow types in the public API... -Check file://[WILDCARD]mod.ts -error[invalid-external-import]: invalid import to a non-JSR 'http' specifier - --> [WILDCARD]mod.ts:1:8 - | -1 | import "http://localhost:4545/welcome.ts"; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the specifier - = hint: replace this import with one from jsr or npm, or vendor the dependency into your package - - info: the import was resolved to 'http://localhost:4545/welcome.ts' - info: this specifier is not allowed to be imported on jsr - info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers - docs: https://jsr.io/go/invalid-external-import - -error[invalid-external-import]: invalid import to a non-JSR 'http' specifier - --> [WILDCARD]mod.ts:2:8 - | -2 | import "$echo"; - | ^^^^^^^ the specifier - = hint: replace this import with one from jsr or npm, or vendor the dependency into your package - - info: the import was resolved to 'http://localhost:4545/echo.ts' - info: this specifier is not allowed to be imported on jsr - info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers - docs: https://jsr.io/go/invalid-external-import - -error: Found 2 problems diff --git a/tests/testdata/publish/invalid_import/deno.json b/tests/testdata/publish/invalid_import/deno.json deleted file mode 100644 index 49b666d22..000000000 --- a/tests/testdata/publish/invalid_import/deno.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "imports": { - "$echo": "http://localhost:4545/echo.ts" - }, - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/invalid_import/mod.ts b/tests/testdata/publish/invalid_import/mod.ts deleted file mode 100644 index bdaf010e2..000000000 --- a/tests/testdata/publish/invalid_import/mod.ts +++ /dev/null @@ -1,9 +0,0 @@ -import "http://localhost:4545/welcome.ts"; -import "$echo"; - -import "data:application/javascript,console.log(1)"; -import "npm:chalk@5"; - -export function foobar(): string { - return "string"; -} diff --git a/tests/testdata/publish/invalid_import_esm_sh_suggestion.out b/tests/testdata/publish/invalid_import_esm_sh_suggestion.out deleted file mode 100644 index a014f3de6..000000000 --- a/tests/testdata/publish/invalid_import_esm_sh_suggestion.out +++ /dev/null @@ -1,20 +0,0 @@ -[WILDCARD] -Check file:///[WILDCARD]/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]mod.ts -error[invalid-external-import]: invalid import to a non-JSR 'http' specifier - --> [WILDCARD]mod.ts:1:8 - | -1 | import "http://esm.sh/react-dom@18.2.0/server"; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the specifier - = hint: replace this import with one from jsr or npm, or vendor the dependency into your package - | -1 | "npm:react-dom@18.2.0" - | ---------------------- try this specifier - - info: the import was resolved to 'http://esm.sh/react-dom@18.2.0/server' - info: this specifier is not allowed to be imported on jsr - info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers - docs: https://jsr.io/go/invalid-external-import - -error: Found 1 problem diff --git a/tests/testdata/publish/invalid_import_esm_sh_suggestion/deno.json b/tests/testdata/publish/invalid_import_esm_sh_suggestion/deno.json deleted file mode 100644 index 49b666d22..000000000 --- a/tests/testdata/publish/invalid_import_esm_sh_suggestion/deno.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "imports": { - "$echo": "http://localhost:4545/echo.ts" - }, - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/invalid_import_esm_sh_suggestion/mod.ts b/tests/testdata/publish/invalid_import_esm_sh_suggestion/mod.ts deleted file mode 100644 index e597218ed..000000000 --- a/tests/testdata/publish/invalid_import_esm_sh_suggestion/mod.ts +++ /dev/null @@ -1,5 +0,0 @@ -import "http://esm.sh/react-dom@18.2.0/server"; - -export function foobar(): string { - return "string"; -} diff --git a/tests/testdata/publish/invalid_path.out b/tests/testdata/publish/invalid_path.out deleted file mode 100644 index d47cb01de..000000000 --- a/tests/testdata/publish/invalid_path.out +++ /dev/null @@ -1,11 +0,0 @@ -Check file://[WILDCARD]mod.ts -Checking for slow types in the public API... -Check file://[WILDCARD]mod.ts -error[invalid-path]: package path must not contain whitespace (found ' ') - --> [WILDCARD]path with spaces.txt - = hint: rename or remove the file, or add it to 'publish.exclude' in the config file - - info: to portably support all platforms, including windows, the allowed characters in package paths are limited - docs: https://jsr.io/go/invalid-path - -error: Found 1 problem diff --git a/tests/testdata/publish/invalid_path/deno.json b/tests/testdata/publish/invalid_path/deno.json deleted file mode 100644 index 213a7cec6..000000000 --- a/tests/testdata/publish/invalid_path/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/invalid_path/mod.ts b/tests/testdata/publish/invalid_path/mod.ts deleted file mode 100644 index 9e217d9b0..000000000 --- a/tests/testdata/publish/invalid_path/mod.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function foobar(): string { - return "string"; -} diff --git a/tests/testdata/publish/invalid_path/path with spaces.txt b/tests/testdata/publish/invalid_path/path with spaces.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/publish/javascript_decl_file.out b/tests/testdata/publish/javascript_decl_file.out deleted file mode 100644 index 48128e82f..000000000 --- a/tests/testdata/publish/javascript_decl_file.out +++ /dev/null @@ -1,5 +0,0 @@ -Check file:///[WILDCARD]/javascript_decl_file/mod.js -Checking for slow types in the public API... -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/javascript_decl_file/deno.json b/tests/testdata/publish/javascript_decl_file/deno.json deleted file mode 100644 index e5dbfa8d3..000000000 --- a/tests/testdata/publish/javascript_decl_file/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.js" - } -} diff --git a/tests/testdata/publish/javascript_decl_file/mod.d.ts b/tests/testdata/publish/javascript_decl_file/mod.d.ts deleted file mode 100644 index b2f6c69a8..000000000 --- a/tests/testdata/publish/javascript_decl_file/mod.d.ts +++ /dev/null @@ -1 +0,0 @@ -export function getRandom(): number; diff --git a/tests/testdata/publish/javascript_decl_file/mod.js b/tests/testdata/publish/javascript_decl_file/mod.js deleted file mode 100644 index 2395e622b..000000000 --- a/tests/testdata/publish/javascript_decl_file/mod.js +++ /dev/null @@ -1,5 +0,0 @@ -/// - -export function getRandom() { - return Math.random(); -} diff --git a/tests/testdata/publish/javascript_missing_decl_file.out b/tests/testdata/publish/javascript_missing_decl_file.out deleted file mode 100644 index 08e92e320..000000000 --- a/tests/testdata/publish/javascript_missing_decl_file.out +++ /dev/null @@ -1,20 +0,0 @@ -Checking for slow types in the public API... -warning[unsupported-javascript-entrypoint]: used a JavaScript module without type declarations as an entrypoint - --> [WILDCARD]mod.js - = hint: add a type declaration (d.ts) for the JavaScript module, or rewrite it to TypeScript - - info: JavaScript files with no corresponding declaration require type inference to be type checked - info: fast check avoids type inference, so JavaScript entrypoints should be avoided - docs: https://jsr.io/go/slow-type-unsupported-javascript-entrypoint - -warning[unsupported-javascript-entrypoint]: used a JavaScript module without type declarations as an entrypoint - --> [WILDCARD]other.js - = hint: add a type declaration (d.ts) for the JavaScript module, or rewrite it to TypeScript - - info: JavaScript files with no corresponding declaration require type inference to be type checked - info: fast check avoids type inference, so JavaScript entrypoints should be avoided - docs: https://jsr.io/go/slow-type-unsupported-javascript-entrypoint - -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/javascript_missing_decl_file/deno.json b/tests/testdata/publish/javascript_missing_decl_file/deno.json deleted file mode 100644 index e12927c26..000000000 --- a/tests/testdata/publish/javascript_missing_decl_file/deno.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.js", - "./other": "./other.js" - } -} diff --git a/tests/testdata/publish/javascript_missing_decl_file/mod.js b/tests/testdata/publish/javascript_missing_decl_file/mod.js deleted file mode 100644 index 4a62fa5b4..000000000 --- a/tests/testdata/publish/javascript_missing_decl_file/mod.js +++ /dev/null @@ -1,3 +0,0 @@ -export function getRandom() { - return Math.random(); -} diff --git a/tests/testdata/publish/javascript_missing_decl_file/other.js b/tests/testdata/publish/javascript_missing_decl_file/other.js deleted file mode 100644 index 89ffb80ba..000000000 --- a/tests/testdata/publish/javascript_missing_decl_file/other.js +++ /dev/null @@ -1,3 +0,0 @@ -export function other() { - return Math.random(); -} diff --git a/tests/testdata/publish/jsr_jsonc/jsr.jsonc b/tests/testdata/publish/jsr_jsonc/jsr.jsonc deleted file mode 100644 index 4c9dfb08c..000000000 --- a/tests/testdata/publish/jsr_jsonc/jsr.jsonc +++ /dev/null @@ -1,11 +0,0 @@ -{ - // It's .jsonc file so it can have comments - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - }, - "imports": { - "@std/http": "./std_http.ts" - } -} diff --git a/tests/testdata/publish/jsr_jsonc/mod.out b/tests/testdata/publish/jsr_jsonc/mod.out deleted file mode 100644 index 38b61d568..000000000 --- a/tests/testdata/publish/jsr_jsonc/mod.out +++ /dev/null @@ -1,6 +0,0 @@ -Check file:///[WILDCARD]/publish/jsr_jsonc/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/jsr_jsonc/mod.ts -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/jsr_jsonc/mod.ts b/tests/testdata/publish/jsr_jsonc/mod.ts deleted file mode 100644 index 6e8a61bae..000000000 --- a/tests/testdata/publish/jsr_jsonc/mod.ts +++ /dev/null @@ -1,7 +0,0 @@ -import http from "@std/http"; - -export function foobar(): { fileServer(): void } { - return { - fileServer: http.fileServer, - }; -} diff --git a/tests/testdata/publish/jsr_jsonc/std_http.ts b/tests/testdata/publish/jsr_jsonc/std_http.ts deleted file mode 100644 index 9d57b36f3..000000000 --- a/tests/testdata/publish/jsr_jsonc/std_http.ts +++ /dev/null @@ -1,6 +0,0 @@ -// temp until we get jsr:@std/http in the test server -export default { - fileServer() { - console.log("Hi"); - }, -}; diff --git a/tests/testdata/publish/missing_deno_json.out b/tests/testdata/publish/missing_deno_json.out deleted file mode 100644 index 2c074bf83..000000000 --- a/tests/testdata/publish/missing_deno_json.out +++ /dev/null @@ -1 +0,0 @@ -error: Couldn't find a deno.json, deno.jsonc, jsr.json or jsr.jsonc configuration file in [WILDCARD] \ No newline at end of file diff --git a/tests/testdata/publish/missing_deno_json/main.ts b/tests/testdata/publish/missing_deno_json/main.ts deleted file mode 100644 index 8d9b8a22a..000000000 --- a/tests/testdata/publish/missing_deno_json/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function add(a: number, b: number): number { - return a + b; -} diff --git a/tests/testdata/publish/no_token.out b/tests/testdata/publish/no_token.out deleted file mode 100644 index 41415094c..000000000 --- a/tests/testdata/publish/no_token.out +++ /dev/null @@ -1 +0,0 @@ -error: No means to authenticate. Pass a token to `--token`[WILDCARD] diff --git a/tests/testdata/publish/node_specifier.out b/tests/testdata/publish/node_specifier.out deleted file mode 100644 index d3e4a367b..000000000 --- a/tests/testdata/publish/node_specifier.out +++ /dev/null @@ -1,8 +0,0 @@ -Download http://localhost:4545/npm/registry/@types/node -Download http://localhost:4545/npm/registry/@types/node/node-[WILDCARD].tgz -Check file:///[WILDCARD]/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/node_specifier/mod.ts -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/node_specifier/deno.json b/tests/testdata/publish/node_specifier/deno.json deleted file mode 100644 index 213a7cec6..000000000 --- a/tests/testdata/publish/node_specifier/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/node_specifier/mod.ts b/tests/testdata/publish/node_specifier/mod.ts deleted file mode 100644 index 9d8263709..000000000 --- a/tests/testdata/publish/node_specifier/mod.ts +++ /dev/null @@ -1,5 +0,0 @@ -import "node:http"; - -export function foobar(): string { - return "string"; -} diff --git a/tests/testdata/publish/package_json.out b/tests/testdata/publish/package_json.out deleted file mode 100644 index 7b54ce8da..000000000 --- a/tests/testdata/publish/package_json.out +++ /dev/null @@ -1,8 +0,0 @@ -Download http://localhost:4545/npm/registry/picocolors -Download http://localhost:4545/npm/registry/picocolors/picocolors-1.0.0.tgz -Check file:///[WILDCARD]/publish/package_json/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/package_json/mod.ts -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/package_json/deno.json b/tests/testdata/publish/package_json/deno.json deleted file mode 100644 index 6e2826ef5..000000000 --- a/tests/testdata/publish/package_json/deno.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - }, - "nodeModulesDir": false -} diff --git a/tests/testdata/publish/package_json/mod.ts b/tests/testdata/publish/package_json/mod.ts deleted file mode 100644 index ae98962fa..000000000 --- a/tests/testdata/publish/package_json/mod.ts +++ /dev/null @@ -1,9 +0,0 @@ -import pc from "picocolors"; - -export function add(a: number, b: number): number { - return a + b; -} - -export function getValue(): string { - return pc.green("hey"); -} diff --git a/tests/testdata/publish/package_json/package.json b/tests/testdata/publish/package_json/package.json deleted file mode 100644 index c1b171f4c..000000000 --- a/tests/testdata/publish/package_json/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@deno/foo", - "version": "0.0.1", - "dependencies": { - "picocolors": "*" - } -} diff --git a/tests/testdata/publish/sloppy_imports.out b/tests/testdata/publish/sloppy_imports.out deleted file mode 100644 index 342eccdc3..000000000 --- a/tests/testdata/publish/sloppy_imports.out +++ /dev/null @@ -1,10 +0,0 @@ -Warning Sloppy module resolution (hint: specify path to index.ts file in directory instead) - at file:///[WILDCARD]/publish/sloppy_imports/mod.ts:1:20 -Check file:///[WILDCARD]/publish/sloppy_imports/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/sloppy_imports/mod.ts -Simulating publish of @foo/bar@1.0.0 with files: - file:///[WILDCARD]/publish/sloppy_imports/b/index.ts (27B) - file:///[WILDCARD]/publish/sloppy_imports/deno.json (87B) - file:///[WILDCARD]/publish/sloppy_imports/mod.ts (35B) -Warning Aborting due to --dry-run diff --git a/tests/testdata/publish/sloppy_imports/b/index.ts b/tests/testdata/publish/sloppy_imports/b/index.ts deleted file mode 100644 index 1392bf6ba..000000000 --- a/tests/testdata/publish/sloppy_imports/b/index.ts +++ /dev/null @@ -1 +0,0 @@ -export const PI = Math.PI; diff --git a/tests/testdata/publish/sloppy_imports/deno.json b/tests/testdata/publish/sloppy_imports/deno.json deleted file mode 100644 index 213a7cec6..000000000 --- a/tests/testdata/publish/sloppy_imports/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/sloppy_imports/mod.ts b/tests/testdata/publish/sloppy_imports/mod.ts deleted file mode 100644 index f5084bb3b..000000000 --- a/tests/testdata/publish/sloppy_imports/mod.ts +++ /dev/null @@ -1 +0,0 @@ -export { PI } from "./b"; diff --git a/tests/testdata/publish/sloppy_imports_no_warnings.out b/tests/testdata/publish/sloppy_imports_no_warnings.out deleted file mode 100644 index 8659010b7..000000000 --- a/tests/testdata/publish/sloppy_imports_no_warnings.out +++ /dev/null @@ -1,8 +0,0 @@ -Check file:///[WILDCARD]/publish/sloppy_imports/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/sloppy_imports/mod.ts -Simulating publish of @foo/bar@1.0.0 with files: - file:///[WILDCARD]/publish/sloppy_imports/b/index.ts (27B) - file:///[WILDCARD]/publish/sloppy_imports/deno.json (87B) - file:///[WILDCARD]/publish/sloppy_imports/mod.ts (35B) -Warning Aborting due to --dry-run diff --git a/tests/testdata/publish/sloppy_imports_not_enabled.out b/tests/testdata/publish/sloppy_imports_not_enabled.out deleted file mode 100644 index c2f74ad2c..000000000 --- a/tests/testdata/publish/sloppy_imports_not_enabled.out +++ /dev/null @@ -1,2 +0,0 @@ -error: [WILDCARD] Maybe specify path to 'index.ts' file in directory instead or run with --unstable-sloppy-imports - at file:///[WILDCARD]/sloppy_imports/mod.ts:1:20 diff --git a/tests/testdata/publish/successful.out b/tests/testdata/publish/successful.out deleted file mode 100644 index a3da4290d..000000000 --- a/tests/testdata/publish/successful.out +++ /dev/null @@ -1,6 +0,0 @@ -Check file:///[WILDCARD]/publish/successful/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/successful/mod.ts -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/successful_no_check.out b/tests/testdata/publish/successful_no_check.out deleted file mode 100644 index 01c53a9ba..000000000 --- a/tests/testdata/publish/successful_no_check.out +++ /dev/null @@ -1,4 +0,0 @@ -Checking for slow types in the public API... -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/symlink.out b/tests/testdata/publish/symlink.out deleted file mode 100644 index 9f89f5b7c..000000000 --- a/tests/testdata/publish/symlink.out +++ /dev/null @@ -1,15 +0,0 @@ -Check [WILDCARD]mod.ts -Checking for slow types in the public API... -Check [WILDCARD]mod.ts -warning[unsupported-file-type]: unsupported file type 'symlink' - --> [WILDCARD]symlink - = hint: remove the file, or add it to 'publish.exclude' in the config file - - info: only files and directories are supported - info: the file was ignored and will not be published - docs: https://jsr.io/go/unsupported-file-type - -Simulating publish of @foo/bar@1.0.0 with files: - [WILDCARD]deno.json (87B) - [WILDCARD]mod.ts (56B) -Warning Aborting due to --dry-run diff --git a/tests/testdata/publish/symlink/deno.json b/tests/testdata/publish/symlink/deno.json deleted file mode 100644 index 213a7cec6..000000000 --- a/tests/testdata/publish/symlink/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/symlink/mod.ts b/tests/testdata/publish/symlink/mod.ts deleted file mode 100644 index 9e217d9b0..000000000 --- a/tests/testdata/publish/symlink/mod.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function foobar(): string { - return "string"; -} diff --git a/tests/testdata/publish/symlink/symlink b/tests/testdata/publish/symlink/symlink deleted file mode 120000 index 0df9bcd04..000000000 --- a/tests/testdata/publish/symlink/symlink +++ /dev/null @@ -1 +0,0 @@ -./mod.ts \ No newline at end of file diff --git a/tests/testdata/publish/unanalyzable_dynamic_import.out b/tests/testdata/publish/unanalyzable_dynamic_import.out deleted file mode 100644 index 7f3ca5555..000000000 --- a/tests/testdata/publish/unanalyzable_dynamic_import.out +++ /dev/null @@ -1,16 +0,0 @@ -Check file://[WILDCARD]/mod.ts -Checking for slow types in the public API... -Check file://[WILDCARD]/mod.ts -warning[unanalyzable-dynamic-import]: unable to analyze dynamic import - --> [WILDCARD]mod.ts:2:14 - | -2 | await import("asd " + asd); - | ^^^^^^^^^^^^ the unanalyzable dynamic import - - info: after publishing this package, imports from the local import map / package.json do not work - info: dynamic imports that can not be analyzed at publish time will not be rewritten automatically - info: make sure the dynamic import is resolvable at runtime without an import map / package.json - -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/unanalyzable_dynamic_import/deno.json b/tests/testdata/publish/unanalyzable_dynamic_import/deno.json deleted file mode 100644 index 213a7cec6..000000000 --- a/tests/testdata/publish/unanalyzable_dynamic_import/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/unanalyzable_dynamic_import/mod.ts b/tests/testdata/publish/unanalyzable_dynamic_import/mod.ts deleted file mode 100644 index 291311385..000000000 --- a/tests/testdata/publish/unanalyzable_dynamic_import/mod.ts +++ /dev/null @@ -1,2 +0,0 @@ -const asd = "asd"; -await import("asd " + asd); diff --git a/tests/testdata/publish/unsupported_jsx_tsx/foo.jsx b/tests/testdata/publish/unsupported_jsx_tsx/foo.jsx deleted file mode 100644 index 021c2d49e..000000000 --- a/tests/testdata/publish/unsupported_jsx_tsx/foo.jsx +++ /dev/null @@ -1,5 +0,0 @@ -import { renderToString } from "npm:preact-render-to-string"; - -export default function render() { - return renderToString(
foo.tsx
); -} diff --git a/tests/testdata/publish/unsupported_jsx_tsx/foo.tsx b/tests/testdata/publish/unsupported_jsx_tsx/foo.tsx deleted file mode 100644 index 021c2d49e..000000000 --- a/tests/testdata/publish/unsupported_jsx_tsx/foo.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { renderToString } from "npm:preact-render-to-string"; - -export default function render() { - return renderToString(
foo.tsx
); -} diff --git a/tests/testdata/publish/unsupported_jsx_tsx/jsr.jsonc b/tests/testdata/publish/unsupported_jsx_tsx/jsr.jsonc deleted file mode 100644 index 7aea08842..000000000 --- a/tests/testdata/publish/unsupported_jsx_tsx/jsr.jsonc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - }, - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "npm:preact" - } -} diff --git a/tests/testdata/publish/unsupported_jsx_tsx/mod.out b/tests/testdata/publish/unsupported_jsx_tsx/mod.out deleted file mode 100644 index 5f085fb33..000000000 --- a/tests/testdata/publish/unsupported_jsx_tsx/mod.out +++ /dev/null @@ -1,17 +0,0 @@ -[WILDCARD] -Check file:///[WILDCARD]/publish/unsupported_jsx_tsx/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/unsupported_jsx_tsx/mod.ts -warning[unsupported-jsx-tsx]: JSX and TSX files are currently not supported - --> [WILDCARD]foo.jsx - - info: follow https://github.com/jsr-io/jsr/issues/24 for updates - -warning[unsupported-jsx-tsx]: JSX and TSX files are currently not supported - --> [WILDCARD]foo.tsx - - info: follow https://github.com/jsr-io/jsr/issues/24 for updates - -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/unsupported_jsx_tsx/mod.ts b/tests/testdata/publish/unsupported_jsx_tsx/mod.ts deleted file mode 100644 index 4631a829d..000000000 --- a/tests/testdata/publish/unsupported_jsx_tsx/mod.ts +++ /dev/null @@ -1,7 +0,0 @@ -import fooTsx from "./foo.tsx"; -import fooJsx from "./foo.jsx"; - -export function renderTsxJsx() { - console.log(fooTsx()); - console.log(fooJsx()); -} diff --git a/tests/testdata/publish/workspace.out b/tests/testdata/publish/workspace.out deleted file mode 100644 index 17f2dab3b..000000000 --- a/tests/testdata/publish/workspace.out +++ /dev/null @@ -1,12 +0,0 @@ -Publishing a workspace... -Check file:///[WILDCARD]/workspace/foo/mod.ts -Check file:///[WILDCARD]/workspace/bar/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/workspace/foo/mod.ts -Check file:///[WILDCARD]/workspace/bar/mod.ts -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details -Publishing @foo/foo@1.0.0 ... -Successfully published @foo/foo@1.0.0 -Visit http://127.0.0.1:4250/@foo/foo@1.0.0 for details diff --git a/tests/testdata/publish/workspace/bar/deno.json b/tests/testdata/publish/workspace/bar/deno.json deleted file mode 100644 index 213a7cec6..000000000 --- a/tests/testdata/publish/workspace/bar/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@foo/bar", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - } -} diff --git a/tests/testdata/publish/workspace/bar/mod.ts b/tests/testdata/publish/workspace/bar/mod.ts deleted file mode 100644 index 8d9b8a22a..000000000 --- a/tests/testdata/publish/workspace/bar/mod.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function add(a: number, b: number): number { - return a + b; -} diff --git a/tests/testdata/publish/workspace/deno.json b/tests/testdata/publish/workspace/deno.json deleted file mode 100644 index 57602aab5..000000000 --- a/tests/testdata/publish/workspace/deno.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "workspaces": [ - "foo", - "bar" - ] -} diff --git a/tests/testdata/publish/workspace/foo/deno.json b/tests/testdata/publish/workspace/foo/deno.json deleted file mode 100644 index 79563d36c..000000000 --- a/tests/testdata/publish/workspace/foo/deno.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@foo/foo", - "version": "1.0.0", - "exports": { - ".": "./mod.ts" - }, - "imports": { - "bar": "jsr:@foo/bar@1" - } -} diff --git a/tests/testdata/publish/workspace/foo/mod.ts b/tests/testdata/publish/workspace/foo/mod.ts deleted file mode 100644 index adf584463..000000000 --- a/tests/testdata/publish/workspace/foo/mod.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as bar from "bar"; - -export function add(a: number, b: number): number { - return bar.add(a, b); -} diff --git a/tests/testdata/publish/workspace_individual.out b/tests/testdata/publish/workspace_individual.out deleted file mode 100644 index e734ae06e..000000000 --- a/tests/testdata/publish/workspace_individual.out +++ /dev/null @@ -1,6 +0,0 @@ -Check file:///[WILDCARD]/workspace/bar/mod.ts -Checking for slow types in the public API... -Check file:///[WILDCARD]/workspace/bar/mod.ts -Publishing @foo/bar@1.0.0 ... -Successfully published @foo/bar@1.0.0 -Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/run/fetch/other.ts b/tests/testdata/run/fetch/other.ts deleted file mode 100644 index 91fe376b3..000000000 --- a/tests/testdata/run/fetch/other.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; diff --git a/tests/testdata/run/fetch/test.ts b/tests/testdata/run/fetch/test.ts deleted file mode 100644 index baa52775d..000000000 --- a/tests/testdata/run/fetch/test.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/subdir/mod2.ts"; diff --git a/tests/testdata/run/with_package_json/no_deno_json/main.out b/tests/testdata/run/with_package_json/no_deno_json/main.out deleted file mode 100644 index 402b30ed4..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/main.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]package.json file found at '[WILDCARD]with_package_json[WILDCARD]no_deno_json[WILDCARD]package.json' -[WILDCARD] -ok -[Function (anonymous)] Chalk [WILDCARD] diff --git a/tests/testdata/run/with_package_json/no_deno_json/main.ts b/tests/testdata/run/with_package_json/no_deno_json/main.ts deleted file mode 100644 index 1e6e50040..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/main.ts +++ /dev/null @@ -1,4 +0,0 @@ -import chalk from "chalk"; - -console.log("ok"); -console.log(chalk); diff --git a/tests/testdata/run/with_package_json/no_deno_json/no_package_json_imports.out b/tests/testdata/run/with_package_json/no_deno_json/no_package_json_imports.out deleted file mode 100644 index 7ed6ff82d..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/no_package_json_imports.out +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/tests/testdata/run/with_package_json/no_deno_json/no_package_json_imports.ts b/tests/testdata/run/with_package_json/no_deno_json/no_package_json_imports.ts deleted file mode 100644 index 0f3785f91..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/no_package_json_imports.ts +++ /dev/null @@ -1 +0,0 @@ -console.log(5); diff --git a/tests/testdata/run/with_package_json/no_deno_json/noconfig.out b/tests/testdata/run/with_package_json/no_deno_json/noconfig.out deleted file mode 100644 index b9f9a6dea..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/noconfig.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]package.json auto-discovery is disabled -[WILDCARD] -success -[WILDCARD] diff --git a/tests/testdata/run/with_package_json/no_deno_json/noconfig.ts b/tests/testdata/run/with_package_json/no_deno_json/noconfig.ts deleted file mode 100644 index 73b348fbc..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/noconfig.ts +++ /dev/null @@ -1,8 +0,0 @@ -// ensure the cwd is this directory -const cwd = Deno.cwd(); -if (!cwd.endsWith("no_deno_json")) { - console.log(cwd); - throw "FAIL"; -} else { - console.log("success"); -} diff --git a/tests/testdata/run/with_package_json/no_deno_json/package.json b/tests/testdata/run/with_package_json/no_deno_json/package.json deleted file mode 100644 index a85b890a8..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dependencies": { - "@denotest/check-error": "1.0.0", - "chalk": "4" - }, - "devDependencies": { - "@denotest/cjs-default-export": "1.0.0" - } -} diff --git a/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.js b/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.js deleted file mode 100644 index 492a8fa40..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import "chalk"; -console.log(Deno.cwd()); -console.log(Deno.statSync("../node_modules")); diff --git a/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.out b/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.out deleted file mode 100644 index 0ec791960..000000000 --- a/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://[WILDCARD] -[WILDCARD]sub_dir -{ - [WILDCARD] - isDirectory: true, - [WILDCARD] -} diff --git a/tests/testdata/test/relative_pattern_dot_slash/deno.json b/tests/testdata/test/relative_pattern_dot_slash/deno.json deleted file mode 100644 index 7c2c4a5d3..000000000 --- a/tests/testdata/test/relative_pattern_dot_slash/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "test": { - "include": [ - "./test/**/*.test.mjs" - ] - } -} diff --git a/tests/testdata/test/relative_pattern_dot_slash/output.out b/tests/testdata/test/relative_pattern_dot_slash/output.out deleted file mode 100644 index be2961cff..000000000 --- a/tests/testdata/test/relative_pattern_dot_slash/output.out +++ /dev/null @@ -1,5 +0,0 @@ -running 1 test from ./test/add.test.mjs -should add ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/relative_pattern_dot_slash/test/add.mjs b/tests/testdata/test/relative_pattern_dot_slash/test/add.mjs deleted file mode 100644 index 7d658310b..000000000 --- a/tests/testdata/test/relative_pattern_dot_slash/test/add.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export function add(a, b) { - return a + b; -} diff --git a/tests/testdata/test/relative_pattern_dot_slash/test/add.test.mjs b/tests/testdata/test/relative_pattern_dot_slash/test/add.test.mjs deleted file mode 100644 index 7b21d2fbc..000000000 --- a/tests/testdata/test/relative_pattern_dot_slash/test/add.test.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import { add } from "./add.mjs"; - -Deno.test("should add", () => { - if (add(1, 2) !== 3) { - throw new Error("FAIL"); - } -}); -- cgit v1.2.3