Skip to content

Commit

Permalink
add pageInstall test
Browse files Browse the repository at this point in the history
  • Loading branch information
JQinglong committed Jun 25, 2023
1 parent a9b543a commit 090ff57
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/libs/actions.install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1467,4 +1467,24 @@ describe("InstallAction", () => {
}
});
});

describe("with pageInstall", () => {
it("exit with error when name is not specified", async () => {
const kyGetStub = createKyGetStub("dummy");
try {
createEmptyDimJson();

await new InstallAction().execute(
{ pageInstall: "https://example.com/dummy.txt", expression: "test" },
undefined,
);
assertSpyCall(consoleLogStub, 0, {
args: [Colors.red("The -n option is not specified.")],
});
assertSpyCall(denoExitStub, 0, { args: [1] });
} finally {
kyGetStub.restore();
}
});
});
});

0 comments on commit 090ff57

Please sign in to comment.