summaryrefslogtreecommitdiff
path: root/cli/test_runner.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-10-14 15:19:13 +0200
committerGitHub <noreply@github.com>2020-10-14 15:19:13 +0200
commit12e700bddfad8c23f6b55baca4ca4afb8337af26 (patch)
tree54c6943cc725e70153db2ef8536c6e6c82b4de9f /cli/test_runner.rs
parente9f02c231473ba42f506a895734d445cd31d379f (diff)
fix(test): return error when awaiting unresolved promise (#7968)
This commit fixes test runner by awaitning "Deno.runTests()" call, which ensures proper error is returned when there's an unresolved promise that's being awaited.
Diffstat (limited to 'cli/test_runner.rs')
-rw-r--r--cli/test_runner.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/test_runner.rs b/cli/test_runner.rs
index 1e91d1c30..fa0da706b 100644
--- a/cli/test_runner.rs
+++ b/cli/test_runner.rs
@@ -82,11 +82,12 @@ pub fn render_test_file(
json!({ "failFast": fail_fast, "reportToConsole": !quiet, "disableLog": quiet })
};
- let run_tests_cmd = format!(
- "// @ts-ignore\nDeno[Deno.internal].runTests({});\n",
+ test_file.push_str("// @ts-ignore\n");
+
+ test_file.push_str(&format!(
+ "await Deno[Deno.internal].runTests({});\n",
options
- );
- test_file.push_str(&run_tests_cmd);
+ ));
test_file
}