Skip to content

Commit

Permalink
Fix incorrect object in debounce test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marcysutton committed Dec 12, 2024
1 parent 7e1912f commit 7eacfef
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 7eacfef

Please sign in to comment.