fix: expose test utils#1890
Merged
Merged
Conversation
Build src/utilities/test.ts into dist so consumers can import easy-ui's test helpers via @easypost/easy-ui/utilities/test: - vite.config.mts: include test.ts in the build glob (still excluding *.test.ts) and externalize vitest + @testing-library/* so they are resolved from the consumer rather than bundled. react-transition-group stays bundled so disable/enableReactTransitionGroup share easy-ui's config instance. - test.ts: drop the ambient `declare global` block (it would leak `var jest` / `IS_REACT_ACT_ENVIRONMENT` into consumers and collide with @types/jest); access the jest global via a local cast instead. - vitest.setup.ts: move the IS_REACT_ACT_ENVIRONMENT declaration here, where it is set; this file is outside the build so it does not ship. Also fix the "testing environment is not configured to support act(...)" warnings: user-event v14 wraps interactions in act() internally, so the manual act() wrappers in userClick/userTab/etc. and in the Tooltip test helpers caused nested-act flag thrashing under fake timers. Remove the redundant wrappers; wrap only the synchronous timer flush.
Stephen Watkins (stephenjwatkins)
marked this pull request as ready for review
June 12, 2026 16:34
Comment on lines
+58
to
+60
| "vitest", | ||
| "@testing-library/react", | ||
| "@testing-library/user-event", |
Member
Author
There was a problem hiding this comment.
We don't want to bundle these, just rely on the consumer having it, if wanting our test utilities.
jallen-cyber
approved these changes
Jun 12, 2026
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.
📝 Changes
✅ Checklist
Easy UI has certain UX standards that must be met. In general, non-trivial changes should meet the following criteria:
Visuals match Design Specs in FigmaStories accompany any component changesDesign tokens are utilizedUnit tests accompany any component changesTSDoc is written for any API surface areaSpecs are up-to-dateConsole is free from warningsNo accessibility violations are reportedCross-browser check is performed (Chrome, Safari, Firefox)Strikethroughany items that are not applicable to this pull request.