Skip to content

Commit

Permalink
pass back exit status from coverage child process to parent
Browse files Browse the repository at this point in the history
  • Loading branch information
okwolf committed Jun 16, 2024
1 parent b2786a9 commit f31b837
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from "path";
import fs from "fs";
import { fileURLToPath } from "url";
import readline from "readline";
import { spawn } from "child_process";
import { spawnSync } from "child_process";
import getFiles from "./getFiles.js";
import runTests from "./runTests.js";
import flattenTests from "./flattenTests.js";
Expand Down Expand Up @@ -48,14 +48,14 @@ export default options => {
coverage
} = options;
if (coverage) {
spawn(
const { status } = spawnSync(
`npx --yes c8 --reporter=text --reporter=lcov node ${__dirname}/tead.js "--testPattern=${testPattern}"`,
{
shell: true,
stdio: "inherit"
}
);
return;
process.exit(status);
}
const testFilter = filename => filename.match(new RegExp(testPattern));
const watchFilter = filename => filename.match(new RegExp(watchPattern));
Expand Down

0 comments on commit f31b837

Please sign in to comment.