1
0
Fork 0

Code coverage for getViaServers

This commit is contained in:
Cadence Ember 2024-02-13 23:32:52 +13:00
parent 56f959e9f3
commit 4f37aaf6a6

View file

@ -152,3 +152,13 @@ test("getViaServers: returns at most 4 results", async t => {
})
t.deepEqual(result.length, 4)
})
test("getViaServers: returns results even when power levels can't be fetched", async t => {
const result = await getViaServers("!baby", {
getStateEvent: async () => {
throw new Error("event not found or something")
},
getJoinedMembers: async () => joinedList(["@_ooye_bot:cadence.moe", "@_ooye_hazel:cadence.moe", "@cadence:cadence.moe", "@moderator:tractor.invalid", "@singleuser:selfhosted.invalid", "@hazel:thecollective.invalid", "@cadence:123example.456example.invalid"])
})
t.deepEqual(result.length, 4)
})