You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
im looking for more help in using the run method from node:test than what the online documentation shows. for example, how can i enable coverage reporting? what would be the way to do the equivalent of --experimental-test-coverage when using the run method? thanks.
Minimal Reproduction
import _process from "node:process";
import { run } from "node:test";
import { tap } from "node:test/reporters";
Node.js Version
v22.2.0
NPM Version
v10.7.0
Operating System
macOS 14.5
Subsystem
Other
Description
im looking for more help in using the run method from
node:test
than what the online documentation shows. for example, how can i enable coverage reporting? what would be the way to do the equivalent of--experimental-test-coverage
when using therun
method? thanks.Minimal Reproduction
import _process from "node:process";
import { run } from "node:test";
import { tap } from "node:test/reporters";
import { glob } from "glob";
async function testSrc(watch: boolean): Promise {
const files = await glob(
["/*.test.ts", "/.test.tsx", "**/.test.js", "/*.test.jsx"],
{ ignore: ["node_modules/", "build/**"] },
);
await run({
files,
watch,
})
.on("test:coverage", (data:any) => {
// this never fires
console.log("test:coverage", { data });
})
.compose(tap)
.pipe(_process.stdout);
}
export default testSrc;
Output
No response
Before You Submit
The text was updated successfully, but these errors were encountered: