diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-02-25 16:14:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-25 16:14:46 +0100 |
commit | d332bf113259f65e90b18b543f19def248e38daa (patch) | |
tree | ed842487aa4f903d50bbb45d8ed2b5292257eda7 /runtime/js | |
parent | 111c343281b559ea51fd66c2ddc260549406a822 (diff) |
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.
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/40_testing.js | 9 |
1 files changed, 8 insertions, 1 deletions
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; }; } |