mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-06 08:24:46 +00:00
test(plugins): pack registry fixtures with the Windows command runner
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user