Skip to content

Commit

Permalink
Merge branch 'main' into fix-panic-delete-closed-property
Browse files Browse the repository at this point in the history
  • Loading branch information
safaa-mojahed authored May 28, 2024
2 parents aa165fd + 8b5089e commit 53b8dee
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ impl CliOptions {
} else if self.maybe_package_json.is_some() {
Ok(Default::default())
} else {
bail!("No config file found")
bail!("deno task couldn't find deno.json(c). See https://deno.land/manual@v{}/getting_started/configuration_file", env!("CARGO_PKG_VERSION"))
}
}

Expand Down
7 changes: 6 additions & 1 deletion cli/tools/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::graph_util::ModuleGraphBuilder;
use crate::npm::CliNpmResolver;
use crate::tsc;
use crate::tsc::Diagnostics;
use crate::util::path::to_percent_decoded_str;
use crate::version;

/// Options for performing a check of a module graph. Note that the decision to
Expand Down Expand Up @@ -154,7 +155,11 @@ impl TypeChecker {

for root in &graph.roots {
let root_str = root.as_str();
log::info!("{} {}", colors::green("Check"), root_str);
log::info!(
"{} {}",
colors::green("Check"),
to_percent_decoded_str(root_str)
);
}

let check_js = ts_config.get_check_js();
Expand Down
4 changes: 3 additions & 1 deletion cli/tools/coverage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ impl crate::worker::CoverageCollector for CoverageCollector {

let script_coverages = self.take_precise_coverage().await?.result;
for script_coverage in script_coverages {
// Filter out internal and http/https JS files from being included in coverage reports
// Filter out internal and http/https JS files and eval'd scripts
// from being included in coverage reports
if script_coverage.url.starts_with("ext:")
|| script_coverage.url.starts_with("[ext:")
|| script_coverage.url.starts_with("http:")
|| script_coverage.url.starts_with("https:")
|| script_coverage.url.starts_with("node:")
|| script_coverage.url.is_empty()
{
continue;
}
Expand Down
4 changes: 3 additions & 1 deletion cli/tools/test/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use phf::phf_map;
use std::borrow::Cow;
use std::ops::AddAssign;

use crate::util::path::to_percent_decoded_str;

use super::*;

pub fn to_relative_path_or_remote_url(cwd: &Url, path_or_url: &str) -> String {
Expand All @@ -19,7 +21,7 @@ pub fn to_relative_path_or_remote_url(cwd: &Url, path_or_url: &str) -> String {
if !r.starts_with("../") {
r = format!("./{r}");
}
return r;
return to_percent_decoded_str(&r);
}
}
path_or_url.to_string()
Expand Down
43 changes: 43 additions & 0 deletions tests/integration/test_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,49 @@ itest!(fail {
output: "test/fail.out",
});

// GHA CI seems to have a problem with Emoji
// https://github.com/denoland/deno/pull/23200#issuecomment-2134032695
#[test]
fn fail_with_contain_unicode_filename() {
let context = TestContextBuilder::new().use_temp_cwd().build();
let temp_dir = context.temp_dir();
temp_dir.write(
"fail_with_contain_unicode_filename🦕.ts",
"Deno.test(\"test 0\", () => {
throw new Error();
});
",
);
let output = context
.new_command()
.args("test fail_with_contain_unicode_filename🦕.ts")
.run();
output.skip_output_check();
output.assert_exit_code(1);
output.assert_matches_text(
"Check [WILDCARD]/fail_with_contain_unicode_filename🦕.ts
running 1 test from ./fail_with_contain_unicode_filename🦕.ts
test 0 ... FAILED ([WILDCARD])
ERRORS
test 0 => ./fail_with_contain_unicode_filename🦕.ts:[WILDCARD]
error: Error
throw new Error();
^
at [WILDCARD]/fail_with_contain_unicode_filename%F0%9F%A6%95.ts:[WILDCARD]
FAILURES
test 0 => ./fail_with_contain_unicode_filename🦕.ts:[WILDCARD]
FAILED | 0 passed | 1 failed ([WILDCARD])
error: Test failed
",
);
}

itest!(collect {
args: "test --ignore=test/collect/ignore test/collect",
exit_code: 0,
Expand Down
4 changes: 4 additions & 0 deletions tests/testdata/coverage/multisource/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ Deno.test("qux", () => {
Deno.test("quux", () => {
quux(false);
});

// Function constructor or eval function generates a new script source internally.
// This call ensures that the coverage data for the eval script source is not generated.
eval("console.log(1)");

0 comments on commit 53b8dee

Please sign in to comment.