fix: resolve cross-package test failures and type errors#53
Open
stooit wants to merge 1 commit into
Open
Conversation
- utils: rename hook export to useSearchDebounce and update apps/web consumer - ui/Button: pass aria-label through and default it for icon-only buttons - ui/DataTable: fix stale-closure in sort handler via functional state update - utils/date: use day-first locale without leading-zero day (1/03/2024) - tsconfig: include bun-types so bun:test resolves (clears tsc errors)
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
Fixes all failing tests and TypeScript errors in the monorepo.
bun run test-> 13 pass / 0 fail;tsc --noEmit-> clean (exit 0). No test files modified, no dependencies added.Bugs fixed
apps/webstill imported the olduseThrottle. The barrel (packages/utils/src/index.ts) now exportsuseSearchDebounceandapps/web/src/lib/api.tsimports that name. Behaviour unchanged.aria-labelis now passed through to the underlying<button>, and icon-only buttons receive a fallbackaria-labelso they always have an accessible name.sortDirat creation time; switched to a functional state updater (setSortDir(prev => ...)) so the controlled re-render test passes. Stale BUG comments removed.formatDatenow uses day-first locale formatting without a leading zero on the day (e.g.1/03/2024), matching the test contract.Config
tsconfig.jsonnow includesbun-types(already innode_modules) so thebun:testmodule resolves — this clears the remainingtsc --noEmiterrors without touching test files.Verification
bun run test-> 13 pass, 0 fail./node_modules/.bin/tsc --noEmit-> no errorsAssumptions
testscript (bun run test), which preloads the DOM setup (packages/ui/test/setup.ts); a barebun testlacks that preload and reports false DOM failures.bun:testtype errors were a pre-existing tsconfig gap (not a test-file bug), fixed via config rather than editing tests.