test(plugins): pack registry fixtures with the Windows command runner

This commit is contained in:
Mohamed Boudra
2026-09-17 00:07:13 +02:00
parent 4f523a5ff8
commit f22c116d23
+2 -5
View File
@@ -1,12 +1,9 @@
import { execFile } from "node:child_process";
import { execCommand } from "../../packages/server/src/utils/spawn.js";
import { createHash } from "node:crypto";
import { createServer } from "node:http";
import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
import { promisify } from "node:util";
const execFileAsync = promisify(execFile);
interface FixturePackage {
name: string;
@@ -68,7 +65,7 @@ export async function startNpmRegistry(packages: FixturePackage[]) {
await mkdir(path.dirname(path.join(directory, file)), { recursive: true });
await writeFile(path.join(directory, file), content);
}
const { stdout } = await execFileAsync("npm", ["pack", "--ignore-scripts", "--json"], {
const { stdout } = await execCommand("npm", ["pack", "--ignore-scripts", "--json"], {
cwd: directory,
});
const packed: Array<{ filename: string }> = JSON.parse(stdout);