Skip to content

Commit 66bf1c4

Browse files
committed
test(commands): tolerate non-registry mock calls
1 parent 9cbd273 commit 66bf1c4

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/commands/channel-setup/plugin-install.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,12 +1003,14 @@ describe("ensureChannelSetupPluginInstalled", () => {
10031003
onlyPluginIds: ["custom-external-chat-plugin"],
10041004
});
10051005
const manifestCall = loadPluginManifestRegistry.mock.calls
1006-
.map((call) => requireRecord(call[0], "manifest registry args"))
1006+
.map((call) => (isRecord(call[0]) ? call[0] : undefined))
10071007
.find((args) =>
1008-
requireArray(args.candidates, "manifest candidates").some((candidate) => {
1009-
const record = requireRecord(candidate, "manifest candidate");
1010-
return record.idHint === "custom-external-chat-plugin" && record.origin === "bundled";
1011-
}),
1008+
args
1009+
? requireArray(args.candidates, "manifest candidates").some((candidate) => {
1010+
const record = requireRecord(candidate, "manifest candidate");
1011+
return record.idHint === "custom-external-chat-plugin" && record.origin === "bundled";
1012+
})
1013+
: false,
10121014
);
10131015
expectRecordFields(manifestCall, "manifest registry args", {
10141016
config: cfg,

0 commit comments

Comments
 (0)