Skip to content

Coverage#274

Open
cubap wants to merge 10 commits into
mainfrom
coverage
Open

Coverage#274
cubap wants to merge 10 commits into
mainfrom
coverage

Conversation

@cubap
Copy link
Copy Markdown
Member

@cubap cubap commented May 15, 2026

extending to the rest of the routes

cubap and others added 10 commits May 13, 2026 15:49
Replace Jest-based test setup with native node:test/assert and update CI. Tests were refactored to use node:test and node:assert (many __tests__ updated), new auth token unit tests added, and routes_mounted.test.js reworked to a data-driven style. The database mock was rewritten to remove Jest-specific APIs and provide a lightweight mock/registry with resetMocks; jest.config.js was removed. GitHub Actions workflows now separate install, test (npm run test:ci) and coverage (npm run coverage:ci) steps. package.json dev tooling and test scripts were adjusted accordingly, and test bootstrap/loader/coverage artifacts were added while placeholder .txt test files were removed.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Introduce createPatchOverrideMiddleware in rest.js to centralize validation of X-HTTP-Method-Override for POST-to-PATCH requests. Replace duplicated inline checks in routes/patchSet.js, routes/patchUnset.js, and routes/patchUpdate.js with the new middleware (each using a route-specific statusMessage). Also standardize error handling by ending 405 responses with res.status(405).end() and export the new middleware from rest.js.
Replace patterns that set status and call next(res) with res.status(405).end() in route fallbacks (routes/query.js, routes/release.js, routes/search.js) to ensure the response is terminated immediately. Add route wrapper tests (routes/__tests__/route_wrappers.test.js) to validate method-override handling, unsupported-method fallbacks, client verify behavior, and API discovery. Include a test coverage inventory (test/coverage-inventory.json) to record current test/coverage state.
Replace next(res) with res.status(405).end() in multiple route fallbacks to ensure responses are terminated immediately (bulkCreate, bulkUpdate, create, delete, history, id, overwrite, putUpdate, since). Update route wrapper tests to import additional routers, add helper asserting fallback behavior on specific paths, and add tests for static/index handlers. Update test coverage inventory to reflect the new/updated tests.
@cubap cubap requested a review from thehabes as a code owner May 15, 2026 17: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.

1 participant