Skip to content

Migrate tests to node:test and update CI#273

Merged
thehabes merged 30 commits into
mainfrom
testing-testing
May 21, 2026
Merged

Migrate tests to node:test and update CI#273
thehabes merged 30 commits into
mainfrom
testing-testing

Conversation

@cubap
Copy link
Copy Markdown
Member

@cubap cubap commented May 13, 2026

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.

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.
@cubap cubap requested a review from thehabes as a code owner May 13, 2026 21:00
@cubap cubap requested a review from Copilot May 13, 2026 21:03

This comment was marked as outdated.

cubap and others added 24 commits May 13, 2026 16:15
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Add middleware for PATCH override support

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.

* End 405 responses and add route wrapper tests

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.

* End responses for unsupported-method handlers

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.
thehabes added 4 commits May 21, 2026 09:46
* Introduce ecosystem file and env-loader for RHEL

* Introduce ecosystem file and env-loader for RHEL

* changes from testing

* cmon RHEL

* back to 500M

* 100% coverage
Adds two regex assertions to each sync-artifact test:
- secrets.OPENAPI must appear verbatim (catches a rename that would
  silently break the receiver checkout step at runtime)
- the literal 'cp source target' line must point at the expected paths
  (already covered for provider sync; now mirrored on shared sync)

Backports improvements developed during TinyNode's parallel sync test
where the same regression class actually bit us this week.
- bump peter-evans/create-pull-request v7 -> v8
- rename receiver checkout path rerum_openapi -> receiver
- add `add-paths`, explicit `base: main`, `ref: main` on receiver checkout
- add `test -f` verify-stub guard on both workflows (receiver stubs exist)
- branch naming automation/sync-rerum-* -> sync/rerum-*
- commit-message/title gain `chore:` prefix
- PR body now matches the bullet-list format used by TinyNode and TinyPen
- update tests to use `path:\s*receiver`, `@v\d+`, and new cp target regex
@thehabes thehabes merged commit ca64f80 into main May 21, 2026
3 checks passed
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.

3 participants