Skip to content

Commit

Permalink
Mock canvas .getContext() to avoid warnings when running Axe checks
Browse files Browse the repository at this point in the history
  • Loading branch information
i-like-robots committed Jun 16, 2024
1 parent 6325565 commit fb121f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/Harness.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import type { OnAdd, OnDelete, OnInput, OnValidate, PublicAPI } from '../sharedT

// HACK: <https://github.com/jsdom/jsdom/issues/1695>
window.HTMLElement.prototype.scrollTo = vi.fn(() => null)
// HACK: <https://github.com/jsdom/jsdom/issues/1782>
window.HTMLCanvasElement.prototype.getContext = vi.fn(() => null)

export type MockedOnAdd = MockedFunction<OnAdd>
export type MockedOnDelete = MockedFunction<OnDelete>
Expand Down

0 comments on commit fb121f4

Please sign in to comment.