diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/tests/testdata/test/steps/failing_steps.out | 4 | ||||
-rw-r--r-- | cli/worker.rs | 49 |
2 files changed, 11 insertions, 42 deletions
diff --git a/cli/tests/testdata/test/steps/failing_steps.out b/cli/tests/testdata/test/steps/failing_steps.out index d8c2bdf8d..1e5f2f64d 100644 --- a/cli/tests/testdata/test/steps/failing_steps.out +++ b/cli/tests/testdata/test/steps/failing_steps.out @@ -38,12 +38,12 @@ failing step in failing test ... FAILED ([WILDCARD]) nested failure => ./test/steps/failing_steps.ts:[WILDCARD] error: Error: 1 test step failed. at runTest (deno:runtime/js/40_testing.js:[WILDCARD]) - at async Object.runTests (deno:runtime/js/40_testing.js:[WILDCARD]) + at async runTests (deno:runtime/js/40_testing.js:[WILDCARD]) multiple test step failures => ./test/steps/failing_steps.ts:[WILDCARD] error: Error: 2 test steps failed. at runTest (deno:runtime/js/40_testing.js:[WILDCARD]) - at async Object.runTests (deno:runtime/js/40_testing.js:[WILDCARD]) + at async runTests (deno:runtime/js/40_testing.js:[WILDCARD]) failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD] error: Error: Fail test. diff --git a/cli/worker.rs b/cli/worker.rs index d7c185fd9..1c4c6475a 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -7,7 +7,6 @@ use deno_core::error::AnyError; use deno_core::futures::task::LocalFutureObj; use deno_core::futures::FutureExt; use deno_core::located_script_name; -use deno_core::serde_json::json; use deno_core::Extension; use deno_core::ModuleId; use deno_graph::source::ResolveResponse; @@ -220,10 +219,7 @@ impl CliMainWorker { &mut self, mode: TestMode, ) -> Result<(), AnyError> { - self.worker.js_runtime.execute_script( - &located_script_name!(), - r#"Deno[Deno.internal].enableTestAndBench()"#, - )?; + self.worker.enable_test(); // Enable op call tracing in core to enable better debugging of op sanitizer // failures. @@ -273,17 +269,10 @@ impl CliMainWorker { } self.worker.dispatch_load_event(&located_script_name!())?; - - let test_result = self.worker.js_runtime.execute_script( - &located_script_name!(), - &format!( - r#"Deno[Deno.internal].runTests({})"#, - json!({ "shuffle": self.ps.options.shuffle_tests() }), - ), - )?; - - self.worker.js_runtime.resolve_value(test_result).await?; - + self + .worker + .run_tests(&self.ps.options.shuffle_tests()) + .await?; loop { if !self .worker @@ -309,10 +298,7 @@ impl CliMainWorker { &mut self, mode: TestMode, ) -> Result<(), AnyError> { - self.worker.js_runtime.execute_script( - &located_script_name!(), - r#"Deno[Deno.internal].enableTestAndBench()"#, - )?; + self.worker.enable_test(); self .worker @@ -328,14 +314,7 @@ impl CliMainWorker { } self.worker.dispatch_load_event(&located_script_name!())?; - - let test_result = self.worker.js_runtime.execute_script( - &located_script_name!(), - r#"Deno[Deno.internal].runTests()"#, - )?; - - self.worker.js_runtime.resolve_value(test_result).await?; - + self.worker.run_tests(&None).await?; loop { if !self .worker @@ -350,10 +329,7 @@ impl CliMainWorker { } pub async fn run_bench_specifier(&mut self) -> Result<(), AnyError> { - self.worker.js_runtime.execute_script( - &located_script_name!(), - r#"Deno[Deno.internal].enableTestAndBench()"#, - )?; + self.worker.enable_bench(); if self.ps.options.compat() { self.worker.execute_side_module(&compat::GLOBAL_URL).await?; @@ -383,14 +359,7 @@ impl CliMainWorker { } self.worker.dispatch_load_event(&located_script_name!())?; - - let bench_result = self.worker.js_runtime.execute_script( - &located_script_name!(), - r#"Deno[Deno.internal].runBenchmarks()"#, - )?; - - self.worker.js_runtime.resolve_value(bench_result).await?; - + self.worker.run_benchmarks().await?; loop { if !self .worker |