deno/tests/specs/run/run_coverage/child_process_coverage_test.ts
Yoshiya Hinosawa 56d7660ee4
feat(cli): add --coverage flag to deno run command (#29329)
closes #16440

This PR adds `--coverage` flag to `deno run` command. When the flag is
specified, it generates the coverage profile in the directory specified
(default is `coverage`). The coverage directory can also be specified
from the env var `DENO_COVERAGE_DIR`.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-06-25 13:34:30 +02:00

6 lines
252 B
TypeScript

Deno.test("foo 1 0", () => runDenoCommand("run foo.ts 1 0"));
Deno.test("foo 0 1", () => runDenoCommand("run foo.ts 0 1"));
async function runDenoCommand(args: string) {
await new Deno.Command(Deno.execPath(), { args: args.split(" ") }).output();
}