Skip to content

fix: mock MuxPlayer in tests to prevent jsdom Web Component errors []#10858

Merged
Mitch Goudy (mgoudy91) merged 1 commit intomasterfrom
fix/mux-mock-player-in-tests
Apr 9, 2026
Merged

fix: mock MuxPlayer in tests to prevent jsdom Web Component errors []#10858
Mitch Goudy (mgoudy91) merged 1 commit intomasterfrom
fix/mux-mock-player-in-tests

Conversation

@mgoudy91
Copy link
Copy Markdown
Contributor

Summary

  • Mux CI was failing with 12 unhandled errors despite all 9 tests passing
  • @mux/mux-player's Web Component crashes jsdom with r.addEventListener is not a function when mounted during tests
  • Adding a vi.mock for @mux/mux-player-react prevents the component from mounting in the test environment

Test plan

  • CI passes with 0 unhandled errors on the mux frontend test run

🤖 Generated with Claude Code

The @mux/mux-player Web Component crashes jsdom with
`r.addEventListener is not a function` when mounted during tests,
causing 12 unhandled errors and CI failure despite all tests passing.
Mocking the component prevents it from mounting in the test environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mgoudy91 Mitch Goudy (mgoudy91) requested a review from a team as a code owner April 9, 2026 16:20
@mgoudy91 Mitch Goudy (mgoudy91) changed the title fix: mock MuxPlayer in tests to prevent jsdom Web Component errors fix: mock MuxPlayer in tests to prevent jsdom Web Component errors [] Apr 9, 2026
@mgoudy91 Mitch Goudy (mgoudy91) merged commit 5f75536 into master Apr 9, 2026
16 of 17 checks passed
@mgoudy91 Mitch Goudy (mgoudy91) deleted the fix/mux-mock-player-in-tests branch April 9, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants