lowlightL
Deno3y ago
8 replies
lowlight

Deno.test without Deno namespace ?

Hi there,

Does someone know if it's possible to run a test from Deno.test without the Deno namespace ?

I tried using a workaround by using Web workers and performing a delete self.Deno which does work but... stumbled upon this issue https://github.com/denoland/deno/issues/13206 . So while I can perform my tests, now I can't get the code coverage since web workers don't collect it.

I'd like to avoid deleting Deno from the main realm since I assume it'd eventually give me some weird behavior

My use-case is to test some functions that behave differently depending on the runtime (like for example whether ˋglobalThis.Deno` is defined or not)
GitHub
$ deno --version deno 1.17.0 (release, x86_64-unknown-linux-gnu) v8 9.7.106.15 typescript 4.5.2 It seems code coverage is not collected for scripts from the worker contexts (neither from the worker...
Code coverage is not collected from `Worker` context(s) · Issue #13...
Was this page helpful?