Open Tkong1 opened 3 weeks ago
You want to change
const test = require('node:test');
to
const { test } = require('node:test');
Thanks a lot for this tip, this works.
Even if i don't really know what the issue with
const test = require('node:test');
is.
We don't handle that case, I didn't know they default-export the test
function. I'll add support for that.
I am new to node:test and wanted to use the extension to execute my first node unit tests. I am usually using CommonJS module style for my node.js projects. But i was only able to see the tests on the Testing window in VSCode if i use the ES6 module style.
Setup: OS: Ubuntu 22.04 VS-Code: v1.90.1 Node.js: v22.3.0 node:test runner: v1.5.1
Test file (ES6): /test/test.js
Test file (CommonJS): test/test.js
When i run the node:test's with the CLI it works with CommonJS module style.