test: guard message helper nullish deps

This commit is contained in:
Peter Steinberger
2026-05-11 20:52:25 +01:00
parent 911d3e969a
commit 10c2a8a311

View File

@@ -109,10 +109,12 @@ function expectMessageCommandOptions(expected: Record<string, unknown>, callInde
for (const [key, expectedValue] of Object.entries(expected)) {
expect(options[key], `messageCommand options.${key}`).toEqual(expectedValue);
}
expect(call[1], "messageCommand runtime").not.toBeNull();
expect(call[1], "messageCommand runtime").not.toBeUndefined();
expect(call[2], "messageCommand deps").not.toBeNull();
expect(call[2], "messageCommand deps").not.toBeUndefined();
if (call[1] == null) {
throw new Error("expected messageCommand runtime");
}
if (call[2] == null) {
throw new Error("expected messageCommand deps");
}
}
describe("runMessageAction", () => {