style: format daemon program args test
This commit is contained in:
@@ -22,15 +22,14 @@ afterEach(() => {
|
|||||||
|
|
||||||
describe("resolveGatewayProgramArguments", () => {
|
describe("resolveGatewayProgramArguments", () => {
|
||||||
it("uses realpath-resolved dist entry when running via npx shim", async () => {
|
it("uses realpath-resolved dist entry when running via npx shim", async () => {
|
||||||
process.argv = [
|
process.argv = ["node", "/tmp/.npm/_npx/63c3/node_modules/.bin/clawdbot"];
|
||||||
"node",
|
|
||||||
"/tmp/.npm/_npx/63c3/node_modules/.bin/clawdbot",
|
|
||||||
];
|
|
||||||
fsMocks.realpath.mockResolvedValue(
|
fsMocks.realpath.mockResolvedValue(
|
||||||
"/tmp/.npm/_npx/63c3/node_modules/clawdbot/dist/entry.js",
|
"/tmp/.npm/_npx/63c3/node_modules/clawdbot/dist/entry.js",
|
||||||
);
|
);
|
||||||
fsMocks.access.mockImplementation(async (target: string) => {
|
fsMocks.access.mockImplementation(async (target: string) => {
|
||||||
if (target === "/tmp/.npm/_npx/63c3/node_modules/clawdbot/dist/entry.js") {
|
if (
|
||||||
|
target === "/tmp/.npm/_npx/63c3/node_modules/clawdbot/dist/entry.js"
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw new Error("missing");
|
throw new Error("missing");
|
||||||
@@ -48,13 +47,12 @@ describe("resolveGatewayProgramArguments", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("falls back to node_modules package dist when .bin path is not resolved", async () => {
|
it("falls back to node_modules package dist when .bin path is not resolved", async () => {
|
||||||
process.argv = [
|
process.argv = ["node", "/tmp/.npm/_npx/63c3/node_modules/.bin/clawdbot"];
|
||||||
"node",
|
|
||||||
"/tmp/.npm/_npx/63c3/node_modules/.bin/clawdbot",
|
|
||||||
];
|
|
||||||
fsMocks.realpath.mockRejectedValue(new Error("no realpath"));
|
fsMocks.realpath.mockRejectedValue(new Error("no realpath"));
|
||||||
fsMocks.access.mockImplementation(async (target: string) => {
|
fsMocks.access.mockImplementation(async (target: string) => {
|
||||||
if (target === "/tmp/.npm/_npx/63c3/node_modules/clawdbot/dist/index.js") {
|
if (
|
||||||
|
target === "/tmp/.npm/_npx/63c3/node_modules/clawdbot/dist/index.js"
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw new Error("missing");
|
throw new Error("missing");
|
||||||
|
|||||||
Reference in New Issue
Block a user