Open yasaichi opened 1 month ago
Looks like this is caused by node:inspector
not being well supported in Deno at the moment.
Related to #23882
I am feeling sorry that all I can do is report bugs. Unfortunately, I ran into the following new error while trying to measure test coverage in the repo with the HEAD of Deno.
Error: Not implemented: inspector.Session.prototype.constructor
❯ notImplemented ext:deno_node/_utils.ts:38:9
❯ new Session node:inspector:22:5
❯ node_modules/.pnpm/@vitest+coverage-v8@2.0.5_vitest@2.0.5/node_modules/@vitest/coverage-v8/dist/index.js:4:17
It means that thanks to @marvinhagemeister, the bug I originally reported was resolved.
Yeah the whole node:inspector
code is basically just stubs at the moment. We need to add code to actually attach and create an inspector.
@marvinhagemeister Thank you so much for your hard work around this topic. BTW as for this issue, feel free to close it.
Due to security implications the Deno team does not plan to polyfill these APIs. https://docs.deno.com/runtime/manual/node/compatibility/
Is the statement about node:inspector
still true even now? If so, should I think that I will never be able to measure test coverage in any nodejs-based testing frameworks relying on the module in the future?
This statement isn't true. We're currently in the process of updating our documentation in preparation for Deno 2.
The error now looks like the below (Updated the title):
Error: Not implemented: inspector.Session.prototype.connect
❯ notImplemented ext:deno_node/_utils.ts:9:9
❯ Session.connect node:inspector:12:5
❯ startCoverage node_modules/.deno/@vitest+coverage-v8@2.0.5/node_modules/@vitest/coverage-v8/dist/index.js:6:11
❯ Object.startCoverage node_modules/.deno/@vitest+coverage-v8@2.0.5/node_modules/@vitest/coverage-v8/dist/index.js:44:12
❯ startCoverageInsideWorker node_modules/.deno/vitest@2.0.5/node_modules/vitest/dist/chunks/coverage.CqfT4xaf.js:47:42
❯ run node_modules/.deno/vitest@2.0.5/node_modules/vitest/dist/chunks/runBaseTests.CyvqmuC9.js:105:3
❯ runBaseTests node_modules/.deno/vitest@2.0.5/node_modules/vitest/dist/chunks/base.CC5R_kgU.js:31:3
❯ ForksBaseWorker.executeTests node_modules/.deno/vitest@2.0.5/node_modules/vitest/dist/workers/forks.js:25:7
❯ execute node_modules/.deno/vitest@2.0.5/node_modules/vitest/dist/worker.js:115:5
❯ onMessage node_modules/.deno/tinypool@1.0.1/node_modules/tinypool/dist/entry/process.js:55:20
Version: Deno 1.45.5
I ran into the following error (panic) when running
DENO_FUTURE=1 deno run -A npm:vitest run --coverage
:This bug always happens when trying to measure test coverage with
@vitest/coverage-v8
. Here is the repo to reproduce it. Thanks you in advance! https://github.com/yasaichi-sandbox/deno-vitest-covNOTE:
@vitest/coverage-istanbul
is another way to measure test coverage and works well with Deno. One cons is that it seems slower than using v8 because of an effort for instrumentation.