Skip to content

test(mabr): cover public discovery export - #24

Merged
kkroo merged 1 commit into
mainfrom
codex/test-public-discovery-api
Oct 26, 2026
Merged

kkroo merged 1 commit into
mainfrom
codex/test-public-discovery-api

Conversation

@kkroo

@kkroo kkroo commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Problem

The browser discovery helper is public API, but the package-entry test only covered the fetch proxy. A package consumer could lose the export without the package tests catching it.

Change

Import discoverSlsEndpoint through @blockcast/mabr-route-proxy's entry point and verify generic delivery-service SLT discovery returns the advertised SLS (S,G) and source.

Validation

  • npm run typecheck
  • npm run build
  • npm test (33 passed)
  • npm run test:e2e

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex (applied directly; no nested CLI).
Reviewed head: ee3f1ea

Looks good. Test-only change: imports discoverSlsEndpoint via src/index.ts and exercises the single-SLT (/slt/<n>) path with a globalServiceID match. Verified against route.ts:233-247 — the /\/slt\/\d+$/ branch fetches base.href once, so the asserted URL is exact, and parseSltEndpoints (route.ts:211-228) yields {group, port, source} in that shape. fetch is restored in finally.

Critical Issues (0)

Important Issues (0)

Suggestions (2)

  • [pr-review-toolkit:tests] packages/mabr-route-proxy/src/index.test.ts:7 — the stub ignores init. discoverSlsEndpoint deliberately sends { credentials: 'omit', mode: 'cors' } (route.ts:239-242, a privacy property of the public API). Accept init?: RequestInit and assert.equal(init?.credentials, 'omit') so a regression there is caught by the same test.
  • [native-codex] packages/mabr-route-proxy/src/index.test.ts:3 — the test covers the entry source (./index.ts), not the built exports["."] → ./dist/index.js mapping. Fine for catching a dropped re-export; just note the PR body's "through the package entry point" means the source entry, and the dist path is only covered by build/test:e2e.

Strengths

  • Closes a real gap: the public discovery export was previously untested from the entry module.
  • Uses globalServiceID string matching, covering the generic delivery-service path rather than only numeric serviceId.

Recommended Action

  1. No blocking changes requested.
  2. Merge once the remaining required CI checks finish green.

@kkroo
kkroo force-pushed the codex/test-public-discovery-api branch from ee3f1ea to d8b57e8 Compare October 26, 2026 06:40

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex (applied directly; no nested CLI).
Reviewed head: d8b57e8

Looks good. Test-only change re-reviewed after the branch was rewritten (prior head is not an ancestor; same single file). The stub now also asserts init.credentials === 'omit' and init.mode === 'cors', matching route.ts:242 at this head — this addresses the earlier suggestion and locks in the privacy property of the public discovery API. The /slt/<n> branch (route.ts:246) fetches the URL once, so the exact-URL assertion holds; discoverSlsEndpoint is re-exported at index.ts:11; fetch is restored in finally.

Critical Issues (0)

Important Issues (0)

Suggestions (1)

  • [native-codex] packages/mabr-route-proxy/src/index.test.ts:3 — the test imports the source entry (./index.ts), not the built exports["."] → dist mapping; the dist path remains covered only by build/test:e2e. Fine for catching a dropped re-export.

Strengths

  • Closes a real coverage gap on a public export, including the credential-omission contract.
  • Exercises the generic globalServiceID string-match path.

Recommended Action

  1. No blocking changes requested.
  2. Merge once the remaining required CI checks finish green.

@kkroo
kkroo merged commit 3e4714d into main Oct 26, 2026
9 checks passed
@kkroo
kkroo deleted the codex/test-public-discovery-api branch October 26, 2026 06:42
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