From 7eacfef8c551b62d4d84697436d0694d40727190 Mon Sep 17 00:00:00 2001 From: Marcy Sutton Todd Date: Thu, 12 Dec 2024 12:36:46 -0800 Subject: [PATCH] Fix incorrect object in debounce test I was trying to avoid having to import the Announcer in this test to keep things isolated, but it's so specific to the Announcer that I decided it didn't matter that much. Specifying the Announcer instance for the scope instead of generic thisArg logic simplified things quite a bit as well. --- .../wonder-blocks-announcer/src/__tests__/util/util.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/wonder-blocks-announcer/src/__tests__/util/util.test.ts b/packages/wonder-blocks-announcer/src/__tests__/util/util.test.ts index f4079ebc2..09d3a0ed5 100644 --- a/packages/wonder-blocks-announcer/src/__tests__/util/util.test.ts +++ b/packages/wonder-blocks-announcer/src/__tests__/util/util.test.ts @@ -20,8 +20,9 @@ describe("Debouncing messages", () => { test("resolving with the first argument passed if debounced multiple times", async () => { // ARRANGE + const announcer = Announcer.getInstance(); const callback = jest.fn((message: string) => message); - const debounced = createDebounceFunction(window, callback, 500); + const debounced = createDebounceFunction(announcer, callback, 500); // ACT debounced("First message");