Skip to content

chore: sim test coverage — add tests for bus edge cases and compute mode transitions #36

Description

@Jah-yee

context

We have 18 TS tests and 25 Python tests. Coverage is decent but some paths are untested:

  • Bus layer: what happens when cap_J overflows? when li_J hits 0? when rectified_W exceeds charge rate?
  • Compute layer: mode transition edges — what triggers sleep→idle, idle→tx, tx→rx? Do the current draws match MODE_CURRENTS exactly?
  • Full sim: restart after flameout with residual bus charge — does the state machine handle it cleanly?

goal

Add tests (TS and/or Python, your call) for these edge cases. Don't aim for 100% coverage — focus on the paths most likely to break if someone changes a constant or threshold.

notes

Look at existing tests in packages/sim/tests/ and python/sim_mini/tests/ for the pattern. Both use assert-based testing, no mocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    hat/engineercontracts, CI, reproducibility, fixtures, boundariessurface/simsimulator, TypeScript package, Python prototype

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions