chore: import upstream snapshot with attribution
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import * as find from "empathic/find";
|
||||
|
||||
const currentFile = process.argv[2];
|
||||
const currentDirectory = path.dirname(currentFile);
|
||||
|
||||
const packageJsonPath = find.file("package.json", { cwd: currentDirectory });
|
||||
|
||||
if (!packageJsonPath) {
|
||||
console.error("No package.json found.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const packageJsonContent = fs.readFileSync(packageJsonPath, "utf8");
|
||||
const packageJson = JSON.parse(packageJsonContent);
|
||||
const packageName = packageJson.name;
|
||||
|
||||
const command = `pnpm`;
|
||||
const args = ["test", "-F", packageName, "--", currentFile];
|
||||
|
||||
const testProcess = spawn(command, args, { stdio: "inherit" });
|
||||
|
||||
testProcess.on("close", (code) => {
|
||||
process.exit(code ?? 1);
|
||||
});
|
||||
Reference in New Issue
Block a user