fix(cli/tools/test): Prefix test module paths with "./" (#14301)

This commit is contained in:
Nayeem Rahman 2022-04-16 20:51:55 +01:00 committed by GitHub
parent 5f2d9a4a22
commit bd6494d119
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 107 additions and 103 deletions

View file

@ -253,10 +253,14 @@ impl PrettyTestReporter {
fn to_relative_path_or_remote_url(&self, path_or_url: &str) -> String {
let url = Url::parse(path_or_url).unwrap();
if url.scheme() == "file" {
self.cwd.make_relative(&url).unwrap()
} else {
path_or_url.to_string()
if let Some(mut r) = self.cwd.make_relative(&url) {
if !r.starts_with("../") {
r = format!("./{}", r);
}
return r;
}
}
path_or_url.to_string()
}
fn force_report_step_wait(&mut self, description: &TestStepDescription) {