fix(web): fix jest-dom matchers not extending vitest expect in test setup#902
Open
xvillarroel wants to merge 1 commit intoComposioHQ:mainfrom
Open
fix(web): fix jest-dom matchers not extending vitest expect in test setup#902xvillarroel wants to merge 1 commit intoComposioHQ:mainfrom
xvillarroel wants to merge 1 commit intoComposioHQ:mainfrom
Conversation
The setup file was using `import "@testing-library/jest-dom/vitest"` but
the vitest subpath's ESM side-effect was not reliably extending vitest's
expect object (the module exports `[Module: null prototype] {}`).
Switch to explicitly importing the matchers and calling `expect.extend()`
directly, which is the documented and reliable approach for vitest 2.x.
This fixes all 83 failing component tests that used toBeInTheDocument,
toHaveAttribute, toHaveClass, etc.
Closes ComposioHQ#1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
toBeInTheDocument,toHaveAttribute,toHaveClass, and other jest-dom matchersimport "@testing-library/jest-dom/vitest"was not reliably extending vitest'sexpectobject (the ESM side-effect module resolved to[Module: null prototype] {})@testing-library/jest-dom/matchersand callexpect.extend(matchers)directly — the documented approach for vitest 2.xTest plan
pnpm --filter @composio/ao-web test— all 513 tests pass (previously 83 failures)pnpm typecheck— passespnpm build— passesCloses #1
🤖 Generated with Claude Code