From d332bf113259f65e90b18b543f19def248e38daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 25 Feb 2022 16:14:46 +0100 Subject: feat: deno test --trace-ops (#13770) This commit adds "--trace-ops" flag to "deno test" subcommand. This flag enables saving of stack traces for async ops, that before were always saved. While the feature proved to be very useful it comes with a significant performance hit, it's caused by excessive source mapping of stack frames. --- runtime/js/40_testing.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'runtime/js') diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js index b15b28c9e..0a40e19f1 100644 --- a/runtime/js/40_testing.js +++ b/runtime/js/40_testing.js @@ -208,9 +208,16 @@ } } - throw `Test case is leaking async ops. + let msg = `Test case is leaking async ops. - ${ArrayPrototypeJoin(details, "\n - ")}`; + + if (!core.isOpCallTracingEnabled()) { + msg += + `\n\nTo get more details where ops were leaked, run again with --trace-ops flag.`; + } + + throw msg; }; } -- cgit v1.2.3