Skip to content

test: production-harden the suite to interfaze-python parity (errors/schema/tasks/guard + coverage gate)#12

Merged
Abhinavexist merged 3 commits into
mainfrom
test/harden-suite
Jul 22, 2026
Merged

test: production-harden the suite to interfaze-python parity (errors/schema/tasks/guard + coverage gate)#12
Abhinavexist merged 3 commits into
mainfrom
test/harden-suite

Conversation

@Abhinavexist

Copy link
Copy Markdown
Collaborator

Mirror of interfaze-python #18 — brings the JS test suite from 49 → 133 tests (9 files) with a coverage gate wired into CI.

Added

  • test/errors.test.ts — HTTP status→error-class mapping (400/401/403/404/429/500/503), error-body forwarding, task+schema conflict, invalid guard code, blacklisted-format (gif/avif) rejection, malformed data-URL/base64, missing API key.
  • test/schema.test.tsresponseFormat (object-root passthrough, non-object wrap under result), emptyTaskSchema, task integration.
  • test/tasks.test.ts — every tasks.* helper (ocr/objectDetection/guiDetection/transcribe/webSearch/scrape/translate/forecast) builds the right request + returns the raw result.
  • test/guard.test.ts<guard> tag serialization, multiple codes, invalid-code throw.
  • test/assets.ts — shared real-URL fixtures (mirror of assets.py).

Deepened

  • inputs 14 → 32, chat 13 → 27, stream 12 → 18 (dataUrl/fromPath/Blob/ArrayBuffer variants, control headers, extra-field pass-through, precontext tolerance, json_object fence edge cases).

Coverage gate

@vitest/coverage-v8 + vitest.config.ts thresholds (95 lines/stmts/funcs, 88 branches — headroom under the actual 100% / 94.2% branches), test:coverage script, CI runs npm run test:coverage.

src/ untouched (tests + config only); typecheck + build + coverage all green.

…ma, coverage gate)

Mirrors interfaze-python PR #18's test hardening: dedicated errors/schema/tasks/guard
suites, a shared real-asset fixture map, deeper inputs/chat/stream coverage (from_path,
data-URL edge cases, control headers, tool-call streaming, malformed side-channels), and
a v8 coverage gate (100% lines/statements/functions, 94%+ branches) wired into CI.
…de 18/20/22 matrix

v8 branch (and occasionally line) counts can shift slightly across Node/V8 versions;
a 100% floor on any metric leaves zero margin. Set lines/statements/functions to 95
and branches to 88 -- comfortably above the "~90%" target while tolerating drift.
@Abhinavexist
Abhinavexist merged commit ab5ff13 into main Jul 22, 2026
3 checks passed
@Abhinavexist
Abhinavexist deleted the test/harden-suite branch July 24, 2026 08:23
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