From 256dcb058ac2dd2a935076922265278c56264050 Mon Sep 17 00:00:00 2001 From: Adilson Schmitt Junior Date: Mon, 2 May 2022 21:43:03 +0200 Subject: fix(test/bench): accept file protocol module specifier CLI args (#14429) --- cli/tests/integration/bench_tests.rs | 17 +++++++++++++++++ cli/tests/integration/test_tests.rs | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/bench_tests.rs b/cli/tests/integration/bench_tests.rs index 6199e5b80..1d021b69b 100644 --- a/cli/tests/integration/bench_tests.rs +++ b/cli/tests/integration/bench_tests.rs @@ -1,6 +1,7 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. use crate::itest; +use deno_core::url::Url; use test_util as util; itest!(requires_unstable { @@ -171,3 +172,19 @@ fn recursive_permissions_pledge() { "pledge test permissions called before restoring previous pledge" )); } + +#[test] +fn file_protocol() { + let file_url = + Url::from_file_path(util::testdata_path().join("bench/file_protocol.ts")) + .unwrap() + .to_string(); + + (util::CheckOutputIntegrationTest { + args_vec: vec!["bench", "--unstable", &file_url], + exit_code: 0, + output: "bench/file_protocol.out", + ..Default::default() + }) + .run(); +} diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index 022e40f4b..0cbc3130f 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -1,6 +1,7 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. use crate::itest; +use deno_core::url::Url; use test_util as util; #[test] @@ -351,3 +352,19 @@ fn recursive_permissions_pledge() { "pledge test permissions called before restoring previous pledge" )); } + +#[test] +fn file_protocol() { + let file_url = + Url::from_file_path(util::testdata_path().join("test/file_protocol.ts")) + .unwrap() + .to_string(); + + (util::CheckOutputIntegrationTest { + args_vec: vec!["test", &file_url], + exit_code: 0, + output: "test/file_protocol.out", + ..Default::default() + }) + .run(); +} -- cgit v1.2.3