Skip to content

Improve browser runtime (runtime.mjs) test coverage to >80% #349

@aallan

Description

@aallan

The browser runtime vera/browser/runtime.mjs is at 57.79% coverage per codecov. The c8 infrastructure was added in #337/#343, but the parity tests don't exercise enough of the runtime code paths.

Current gaps (estimated)

  • Map/Set/Decimal host imports — many type-specific branches untested
  • Json host imports (new in this release) — writeJson/readJson untested in browser
  • Markdown marshalling — some constructor paths untested
  • Error paths — contract violations, invalid inputs

Approach

Add targeted browser parity tests in tests/test_browser.py that exercise:

  1. Each Map value type variant (Int, Float64, String, Bool)
  2. Each Set element type variant
  3. Decimal operations (arithmetic, comparison, conversion)
  4. Json parse/stringify with nested objects and arrays
  5. Error paths (invalid JSON, contract violations)

The c8 coverage data is already collected during VERA_JS_COVERAGE=1 pytest tests/test_browser.py — we just need more test cases.

Target: >80% line coverage on runtime.mjs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciCI/CD and GitHub ActionstoolingIssue around tooling built for the language (e.g. package managers, IDE plug-ins)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions