Repository navigation
test: strengthen v5 unit coverage and fix uncovered regressions - #245
Merged
Merged
Conversation
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
Strengthen v5 unit coverage in ten high-risk libraries, with feature/module-grouped test files and stricter statement, branch, function and line floors. Existing source coverage inclusion/exclusion rules are unchanged; no tests or coverage paths are skipped.
Tests cover query execution and decoding, pagination and polymorphic reads, insert/conflict hooks, ORM identity tracking and concurrency failures, CLI routing and migrations, scheduler lifecycle and worker coordination, PostgreSQL storage and migrations, client transports and React hooks, multipart/WebSocket limits, nested mapping, form validation failures and deep utilities.
Measured coverage
Comparison against the successful Node 24 CI artifact for development commit
4d5efff2926b8a179075cfd5f5cc9e3419f1b411, using the same coverage configuration. Values are statement / branch percentages.Historical v4 README badges are not a directly comparable baseline: coverage configuration changed, including TSX source inclusion. This PR uses an exact v5 baseline and refreshes badges from a complete passing run.
The database unit suites use real Knex compilation and a simulated driver boundary. They exercise SQL, bindings, decoding and error handling, but do not replace real PostgreSQL concurrency, transaction or lease tests. Real database suites and packaged-worker tests are retained, and this distinction is documented in CONTRIBUTING.
Bugs found and fixed
useSubscription({ maxEvents: 0 })keeps no event history while still exposing the last event.next()closes the WebSocket with policy-violation code 1008 instead of leaving it open.Each published behavior fix has a patch changeset and regression tests. Relevant API documentation is updated.
Validation
Full GitHub CI passed: lint/build/test, PostgreSQL query and scheduler integrations, S3 integration, demo API/browser/telemetry E2E, packed-package checks, documentation website builds and API-reference generation.
npm run lint— passednpm run build— passednpm run test— 293 files, 5,303 tests passed; no type errorsnpm run test:coverage— passed; all published-package floors passednpm run test:queries:integration— 102 tests passed against isolated PostgreSQL in UTC and America/Los_Angelesnpm run test:scheduler:integration— 12 tests passed against isolated PostgreSQL in UTC and America/Los_Angelesnpm run test:packages— 22 packages and 52 entry points passed (licenses, declarations, exports and browser bundle)npm run typecheck:schema-siteandnpm run typecheck:docs-site— passednpm audit --audit-level=high— passed; npm reports 3 low and 2 moderate existing dependency advisories, no high/critical findings (dependency changes are outside this coverage PR)The existing CI also runs real PostgreSQL in UTC and America/Los_Angeles, S3 storage integration, demo API/browser/telemetry E2E, documentation builds and API-reference generation. No publication or merging is performed by this PR.