Skip to content

Commit 59ad618

Browse files
While I'm here, one more readOptions test
1 parent 80f4041 commit 59ad618

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/shared/options/readOptions.test.ts

+19
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,25 @@ describe("readOptions", () => {
320320
});
321321
});
322322

323+
it("returns cancelled options when augmentOptionsWithExcludes returns undefined", async () => {
324+
mockAugmentOptionsWithExcludes.mockResolvedValue(undefined);
325+
mockGetPrefillOrPromptedOption.mockImplementation(() => "mock");
326+
327+
expect(
328+
await readOptions(["--base", mockOptions.base], "create"),
329+
).toStrictEqual({
330+
cancelled: true,
331+
options: {
332+
...emptyOptions,
333+
base: mockOptions.base,
334+
description: "mock",
335+
owner: "mock",
336+
repository: "mock",
337+
title: "mock",
338+
},
339+
});
340+
});
341+
323342
it("defaults preserveGeneratedFrom to false when the owner is not JoshuaKGoldberg", async () => {
324343
mockAugmentOptionsWithExcludes.mockImplementationOnce(
325344
(options: Partial<Options>) => ({

0 commit comments

Comments
 (0)