From d13938550d6173c2239f9a4ba5c69efbe60ad379 Mon Sep 17 00:00:00 2001 From: Paula Date: Tue, 6 Oct 2026 20:01:03 -0300 Subject: [PATCH] Update /give test --- tests/commands_test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/commands_test.ts b/tests/commands_test.ts index d25e038..4e7bb72 100644 --- a/tests/commands_test.ts +++ b/tests/commands_test.ts @@ -130,10 +130,12 @@ Deno.test("/give suggests item ids as they're typed", async () => { // just the ids assertEquals(carrots.suggestions, [{ text: "bworld:carrot" }]); - // every item, but not air - const all = suggest("/give ").suggestions.map((s: { text: string }) => s.text); - assert(all.includes("bworld:stone") && all.includes("farmersdelight:cabbage"), String(all)); - assert(!all.includes("bworld:air")); + // items from every mod, but not air. the server sends at most 100, so these look past the first ones + const ids = (text: string) => suggest(text).suggestions.map((s: { text: string }) => s.text); + assertEquals(ids("/give ").length, 100); + assert(ids("/give bworld:sto").includes("bworld:stone")); + assert(ids("/give farmersdelight:cab").includes("farmersdelight:cabbage")); + assert(!ids("/give bworld:a").includes("bworld:air")); assertEquals(suggest("/give farmersdelight:tom").suggestions.map((s: { text: string }) => s.text), [ "farmersdelight:tomato", "farmersdelight:tomato_sauce",