diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 103e3142ea..de894f064a 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -400,7 +400,7 @@ fn js_unit_tests() { .arg("--unstable") .arg("--reload") .arg("-A") - .arg("cli/js/tests/unit_test_runner.ts") + .arg("cli/tests/unit/unit_test_runner.ts") .arg("--master") .arg("--verbose") .env("NO_COLOR", "1") diff --git a/cli/js/tests/README.md b/cli/tests/unit/README.md similarity index 77% rename from cli/js/tests/README.md rename to cli/tests/unit/README.md index ea52f12423..c333b00465 100644 --- a/cli/js/tests/README.md +++ b/cli/tests/unit/README.md @@ -42,7 +42,7 @@ ways: `unit_test_runner.ts` is the main script used to run unit tests. Runner discovers required permissions combinations by loading -`cli/js/tests/unit_tests.ts` and going through all registered instances of +`cli/tests/unit/unit_tests.ts` and going through all registered instances of `unitTest`. There are three ways to run `unit_test_runner.ts`: @@ -50,27 +50,27 @@ There are three ways to run `unit_test_runner.ts`: ``` # Run all tests. Spawns worker processes for each discovered permission # combination: -target/debug/deno run -A cli/js/tests/unit_test_runner.ts --master +target/debug/deno run -A cli/tests/unit/unit_test_runner.ts --master # By default all output of worker processes is discarded; for debug purposes # the --verbose flag preserves output from the worker -target/debug/deno run -A cli/js/tests/unit_test_runner.ts --master --verbose +target/debug/deno run -A cli/tests/unit/unit_test_runner.ts --master --verbose # Run subset of tests that don't require any permissions -target/debug/deno run --unstable cli/js/tests/unit_test_runner.ts +target/debug/deno run --unstable cli/tests/unit/unit_test_runner.ts # Run subset tests that require "net" and "read" permissions -target/debug/deno run --unstable --allow-net --allow-read cli/js/tests/unit_test_runner.ts +target/debug/deno run --unstable --allow-net --allow-read cli/tests/unit/unit_test_runner.ts # "worker" mode communicates with parent using TCP socket on provided address; # after initial setup drops permissions to specified set. It shouldn't be used # directly, only be "master" process. -target/debug/deno run -A cli/js/tests/unit_test_runner.ts --worker --addr=127.0.0.1:4500 --perms=net,write,run +target/debug/deno run -A cli/tests/unit/unit_test_runner.ts --worker --addr=127.0.0.1:4500 --perms=net,write,run # Run specific tests -target/debug/deno run --unstable --allow-net cli/js/tests/unit_test_runner.ts -- netTcpListenClose +target/debug/deno run --unstable --allow-net cli/tests/unit/unit_test_runner.ts -- netTcpListenClose -RUST_BACKTRACE=1 cargo run -- run --unstable --allow-read --allow-write cli/js/tests/unit_test_runner.ts -- netUnixDialListen +RUST_BACKTRACE=1 cargo run -- run --unstable --allow-read --allow-write cli/tests/unit/unit_test_runner.ts -- netUnixDialListen ``` ### Http server diff --git a/cli/js/tests/abort_controller_test.ts b/cli/tests/unit/abort_controller_test.ts similarity index 100% rename from cli/js/tests/abort_controller_test.ts rename to cli/tests/unit/abort_controller_test.ts diff --git a/cli/js/tests/blob_test.ts b/cli/tests/unit/blob_test.ts similarity index 100% rename from cli/js/tests/blob_test.ts rename to cli/tests/unit/blob_test.ts diff --git a/cli/js/tests/body_test.ts b/cli/tests/unit/body_test.ts similarity index 100% rename from cli/js/tests/body_test.ts rename to cli/tests/unit/body_test.ts diff --git a/cli/js/tests/buffer_test.ts b/cli/tests/unit/buffer_test.ts similarity index 100% rename from cli/js/tests/buffer_test.ts rename to cli/tests/unit/buffer_test.ts diff --git a/cli/js/tests/build_test.ts b/cli/tests/unit/build_test.ts similarity index 100% rename from cli/js/tests/build_test.ts rename to cli/tests/unit/build_test.ts diff --git a/cli/js/tests/chmod_test.ts b/cli/tests/unit/chmod_test.ts similarity index 100% rename from cli/js/tests/chmod_test.ts rename to cli/tests/unit/chmod_test.ts diff --git a/cli/js/tests/chown_test.ts b/cli/tests/unit/chown_test.ts similarity index 100% rename from cli/js/tests/chown_test.ts rename to cli/tests/unit/chown_test.ts diff --git a/cli/js/tests/console_test.ts b/cli/tests/unit/console_test.ts similarity index 100% rename from cli/js/tests/console_test.ts rename to cli/tests/unit/console_test.ts diff --git a/cli/js/tests/copy_file_test.ts b/cli/tests/unit/copy_file_test.ts similarity index 100% rename from cli/js/tests/copy_file_test.ts rename to cli/tests/unit/copy_file_test.ts diff --git a/cli/js/tests/custom_event_test.ts b/cli/tests/unit/custom_event_test.ts similarity index 100% rename from cli/js/tests/custom_event_test.ts rename to cli/tests/unit/custom_event_test.ts diff --git a/cli/js/tests/dir_test.ts b/cli/tests/unit/dir_test.ts similarity index 100% rename from cli/js/tests/dir_test.ts rename to cli/tests/unit/dir_test.ts diff --git a/cli/js/tests/dispatch_json_test.ts b/cli/tests/unit/dispatch_json_test.ts similarity index 100% rename from cli/js/tests/dispatch_json_test.ts rename to cli/tests/unit/dispatch_json_test.ts diff --git a/cli/js/tests/dispatch_minimal_test.ts b/cli/tests/unit/dispatch_minimal_test.ts similarity index 100% rename from cli/js/tests/dispatch_minimal_test.ts rename to cli/tests/unit/dispatch_minimal_test.ts diff --git a/cli/js/tests/dom_exception_test.ts b/cli/tests/unit/dom_exception_test.ts similarity index 100% rename from cli/js/tests/dom_exception_test.ts rename to cli/tests/unit/dom_exception_test.ts diff --git a/cli/js/tests/dom_iterable_test.ts b/cli/tests/unit/dom_iterable_test.ts similarity index 100% rename from cli/js/tests/dom_iterable_test.ts rename to cli/tests/unit/dom_iterable_test.ts diff --git a/cli/js/tests/error_stack_test.ts b/cli/tests/unit/error_stack_test.ts similarity index 100% rename from cli/js/tests/error_stack_test.ts rename to cli/tests/unit/error_stack_test.ts diff --git a/cli/js/tests/event_target_test.ts b/cli/tests/unit/event_target_test.ts similarity index 100% rename from cli/js/tests/event_target_test.ts rename to cli/tests/unit/event_target_test.ts diff --git a/cli/js/tests/event_test.ts b/cli/tests/unit/event_test.ts similarity index 100% rename from cli/js/tests/event_test.ts rename to cli/tests/unit/event_test.ts diff --git a/cli/js/tests/fetch_test.ts b/cli/tests/unit/fetch_test.ts similarity index 100% rename from cli/js/tests/fetch_test.ts rename to cli/tests/unit/fetch_test.ts diff --git a/cli/js/tests/file_test.ts b/cli/tests/unit/file_test.ts similarity index 100% rename from cli/js/tests/file_test.ts rename to cli/tests/unit/file_test.ts diff --git a/cli/js/tests/files_test.ts b/cli/tests/unit/files_test.ts similarity index 100% rename from cli/js/tests/files_test.ts rename to cli/tests/unit/files_test.ts diff --git a/cli/js/tests/form_data_test.ts b/cli/tests/unit/form_data_test.ts similarity index 100% rename from cli/js/tests/form_data_test.ts rename to cli/tests/unit/form_data_test.ts diff --git a/cli/js/tests/format_error_test.ts b/cli/tests/unit/format_error_test.ts similarity index 100% rename from cli/js/tests/format_error_test.ts rename to cli/tests/unit/format_error_test.ts diff --git a/cli/js/tests/fs_events_test.ts b/cli/tests/unit/fs_events_test.ts similarity index 100% rename from cli/js/tests/fs_events_test.ts rename to cli/tests/unit/fs_events_test.ts diff --git a/cli/js/tests/get_random_values_test.ts b/cli/tests/unit/get_random_values_test.ts similarity index 100% rename from cli/js/tests/get_random_values_test.ts rename to cli/tests/unit/get_random_values_test.ts diff --git a/cli/js/tests/globals_test.ts b/cli/tests/unit/globals_test.ts similarity index 100% rename from cli/js/tests/globals_test.ts rename to cli/tests/unit/globals_test.ts diff --git a/cli/js/tests/headers_test.ts b/cli/tests/unit/headers_test.ts similarity index 100% rename from cli/js/tests/headers_test.ts rename to cli/tests/unit/headers_test.ts diff --git a/cli/js/tests/internals_test.ts b/cli/tests/unit/internals_test.ts similarity index 100% rename from cli/js/tests/internals_test.ts rename to cli/tests/unit/internals_test.ts diff --git a/cli/js/tests/io_test.ts b/cli/tests/unit/io_test.ts similarity index 100% rename from cli/js/tests/io_test.ts rename to cli/tests/unit/io_test.ts diff --git a/cli/js/tests/link_test.ts b/cli/tests/unit/link_test.ts similarity index 100% rename from cli/js/tests/link_test.ts rename to cli/tests/unit/link_test.ts diff --git a/cli/js/tests/make_temp_test.ts b/cli/tests/unit/make_temp_test.ts similarity index 100% rename from cli/js/tests/make_temp_test.ts rename to cli/tests/unit/make_temp_test.ts diff --git a/cli/js/tests/metrics_test.ts b/cli/tests/unit/metrics_test.ts similarity index 100% rename from cli/js/tests/metrics_test.ts rename to cli/tests/unit/metrics_test.ts diff --git a/cli/js/tests/mkdir_test.ts b/cli/tests/unit/mkdir_test.ts similarity index 100% rename from cli/js/tests/mkdir_test.ts rename to cli/tests/unit/mkdir_test.ts diff --git a/cli/js/tests/net_test.ts b/cli/tests/unit/net_test.ts similarity index 100% rename from cli/js/tests/net_test.ts rename to cli/tests/unit/net_test.ts diff --git a/cli/js/tests/os_test.ts b/cli/tests/unit/os_test.ts similarity index 100% rename from cli/js/tests/os_test.ts rename to cli/tests/unit/os_test.ts diff --git a/cli/js/tests/performance_test.ts b/cli/tests/unit/performance_test.ts similarity index 100% rename from cli/js/tests/performance_test.ts rename to cli/tests/unit/performance_test.ts diff --git a/cli/js/tests/permissions_test.ts b/cli/tests/unit/permissions_test.ts similarity index 100% rename from cli/js/tests/permissions_test.ts rename to cli/tests/unit/permissions_test.ts diff --git a/cli/js/tests/process_test.ts b/cli/tests/unit/process_test.ts similarity index 100% rename from cli/js/tests/process_test.ts rename to cli/tests/unit/process_test.ts diff --git a/cli/js/tests/read_dir_test.ts b/cli/tests/unit/read_dir_test.ts similarity index 100% rename from cli/js/tests/read_dir_test.ts rename to cli/tests/unit/read_dir_test.ts diff --git a/cli/js/tests/read_file_test.ts b/cli/tests/unit/read_file_test.ts similarity index 100% rename from cli/js/tests/read_file_test.ts rename to cli/tests/unit/read_file_test.ts diff --git a/cli/js/tests/read_link_test.ts b/cli/tests/unit/read_link_test.ts similarity index 100% rename from cli/js/tests/read_link_test.ts rename to cli/tests/unit/read_link_test.ts diff --git a/cli/js/tests/read_text_file_test.ts b/cli/tests/unit/read_text_file_test.ts similarity index 100% rename from cli/js/tests/read_text_file_test.ts rename to cli/tests/unit/read_text_file_test.ts diff --git a/cli/js/tests/real_path_test.ts b/cli/tests/unit/real_path_test.ts similarity index 100% rename from cli/js/tests/real_path_test.ts rename to cli/tests/unit/real_path_test.ts diff --git a/cli/js/tests/remove_test.ts b/cli/tests/unit/remove_test.ts similarity index 100% rename from cli/js/tests/remove_test.ts rename to cli/tests/unit/remove_test.ts diff --git a/cli/js/tests/rename_test.ts b/cli/tests/unit/rename_test.ts similarity index 100% rename from cli/js/tests/rename_test.ts rename to cli/tests/unit/rename_test.ts diff --git a/cli/js/tests/request_test.ts b/cli/tests/unit/request_test.ts similarity index 100% rename from cli/js/tests/request_test.ts rename to cli/tests/unit/request_test.ts diff --git a/cli/js/tests/resources_test.ts b/cli/tests/unit/resources_test.ts similarity index 100% rename from cli/js/tests/resources_test.ts rename to cli/tests/unit/resources_test.ts diff --git a/cli/js/tests/signal_test.ts b/cli/tests/unit/signal_test.ts similarity index 100% rename from cli/js/tests/signal_test.ts rename to cli/tests/unit/signal_test.ts diff --git a/cli/js/tests/stat_test.ts b/cli/tests/unit/stat_test.ts similarity index 100% rename from cli/js/tests/stat_test.ts rename to cli/tests/unit/stat_test.ts diff --git a/cli/js/tests/streams_piping_test.ts b/cli/tests/unit/streams_piping_test.ts similarity index 100% rename from cli/js/tests/streams_piping_test.ts rename to cli/tests/unit/streams_piping_test.ts diff --git a/cli/js/tests/streams_transform_test.ts b/cli/tests/unit/streams_transform_test.ts similarity index 100% rename from cli/js/tests/streams_transform_test.ts rename to cli/tests/unit/streams_transform_test.ts diff --git a/cli/js/tests/streams_writable_test.ts b/cli/tests/unit/streams_writable_test.ts similarity index 100% rename from cli/js/tests/streams_writable_test.ts rename to cli/tests/unit/streams_writable_test.ts diff --git a/cli/js/tests/symlink_test.ts b/cli/tests/unit/symlink_test.ts similarity index 100% rename from cli/js/tests/symlink_test.ts rename to cli/tests/unit/symlink_test.ts diff --git a/cli/js/tests/test_util.ts b/cli/tests/unit/test_util.ts similarity index 97% rename from cli/js/tests/test_util.ts rename to cli/tests/unit/test_util.ts index 24186db71f..1c5b6ff212 100644 --- a/cli/js/tests/test_util.ts +++ b/cli/tests/unit/test_util.ts @@ -327,12 +327,12 @@ unitTest(function permissionsMatches(): void { /* * Ensure all unit test files (e.g. xxx_test.ts) are present as imports in - * cli/js/tests/unit_tests.ts as it is easy to miss this out + * cli/tests/unit/unit_tests.ts as it is easy to miss this out */ unitTest( { perms: { read: true } }, function assertAllUnitTestFilesImported(): void { - const directoryTestFiles = [...Deno.readDirSync("./cli/js/tests/")] + const directoryTestFiles = [...Deno.readDirSync("./cli/tests/unit/")] .map((k) => k.name) .filter( (file) => @@ -342,7 +342,7 @@ unitTest( !file!.endsWith("unit_test_runner.ts") ); const unitTestsFile: Uint8Array = Deno.readFileSync( - "./cli/js/tests/unit_tests.ts" + "./cli/tests/unit/unit_tests.ts" ); const importLines = new TextDecoder("utf-8") .decode(unitTestsFile) @@ -355,7 +355,7 @@ unitTest( directoryTestFiles.forEach((dirFile) => { if (!importedTestFiles.includes(dirFile!)) { throw new Error( - "cil/js/tests/unit_tests.ts is missing import of test file: cli/js/" + + "cil/tests/unit/unit_tests.ts is missing import of test file: cli/js/" + dirFile ); } diff --git a/cli/js/tests/testing_test.ts b/cli/tests/unit/testing_test.ts similarity index 100% rename from cli/js/tests/testing_test.ts rename to cli/tests/unit/testing_test.ts diff --git a/cli/js/tests/text_encoding_test.ts b/cli/tests/unit/text_encoding_test.ts similarity index 100% rename from cli/js/tests/text_encoding_test.ts rename to cli/tests/unit/text_encoding_test.ts diff --git a/cli/js/tests/timers_test.ts b/cli/tests/unit/timers_test.ts similarity index 100% rename from cli/js/tests/timers_test.ts rename to cli/tests/unit/timers_test.ts diff --git a/cli/js/tests/tls_test.ts b/cli/tests/unit/tls_test.ts similarity index 100% rename from cli/js/tests/tls_test.ts rename to cli/tests/unit/tls_test.ts diff --git a/cli/js/tests/truncate_test.ts b/cli/tests/unit/truncate_test.ts similarity index 100% rename from cli/js/tests/truncate_test.ts rename to cli/tests/unit/truncate_test.ts diff --git a/cli/js/tests/tty_test.ts b/cli/tests/unit/tty_test.ts similarity index 100% rename from cli/js/tests/tty_test.ts rename to cli/tests/unit/tty_test.ts diff --git a/cli/js/tests/umask_test.ts b/cli/tests/unit/umask_test.ts similarity index 100% rename from cli/js/tests/umask_test.ts rename to cli/tests/unit/umask_test.ts diff --git a/cli/js/tests/unit_test_runner.ts b/cli/tests/unit/unit_test_runner.ts similarity index 99% rename from cli/js/tests/unit_test_runner.ts rename to cli/tests/unit/unit_test_runner.ts index 12d9101b85..715dda5001 100755 --- a/cli/js/tests/unit_test_runner.ts +++ b/cli/tests/unit/unit_test_runner.ts @@ -96,7 +96,7 @@ function spawnWorkerRunner( "run", "--unstable", // TODO(ry) be able to test stable vs unstable "-A", - "cli/js/tests/unit_test_runner.ts", + "cli/tests/unit/unit_test_runner.ts", "--worker", `--addr=${addr}`, `--perms=${permStr}`, diff --git a/cli/js/tests/unit_tests.ts b/cli/tests/unit/unit_tests.ts similarity index 100% rename from cli/js/tests/unit_tests.ts rename to cli/tests/unit/unit_tests.ts diff --git a/cli/js/tests/url_search_params_test.ts b/cli/tests/unit/url_search_params_test.ts similarity index 100% rename from cli/js/tests/url_search_params_test.ts rename to cli/tests/unit/url_search_params_test.ts diff --git a/cli/js/tests/url_test.ts b/cli/tests/unit/url_test.ts similarity index 100% rename from cli/js/tests/url_test.ts rename to cli/tests/unit/url_test.ts diff --git a/cli/js/tests/utime_test.ts b/cli/tests/unit/utime_test.ts similarity index 100% rename from cli/js/tests/utime_test.ts rename to cli/tests/unit/utime_test.ts diff --git a/cli/js/tests/version_test.ts b/cli/tests/unit/version_test.ts similarity index 100% rename from cli/js/tests/version_test.ts rename to cli/tests/unit/version_test.ts diff --git a/cli/js/tests/write_file_test.ts b/cli/tests/unit/write_file_test.ts similarity index 100% rename from cli/js/tests/write_file_test.ts rename to cli/tests/unit/write_file_test.ts diff --git a/cli/js/tests/write_text_file_test.ts b/cli/tests/unit/write_text_file_test.ts similarity index 100% rename from cli/js/tests/write_text_file_test.ts rename to cli/tests/unit/write_text_file_test.ts