test: expand CSE machine test coverage to 61 tests#45
Conversation
|
There was a problem hiding this comment.
Code Review
This pull request significantly expands the test coverage for the CSE machine across the common, runner, and web packages, introducing structured test suites for constants, structured-clone safety, and message validation. The review feedback focuses on code quality improvements in the test files: extracting a duplicated array to a constant in common.test.ts to avoid unnecessary allocations, and refactoring the makeChannel helper in runner.test.ts to return a strongly-typed mock, which eliminates the need for multiple redundant type assertions throughout the file.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Expands test coverage for the three CSE machine packages from 8 tests to 61.
common(1 → 22 tests): constants values, structured-clone safety for all snapshot shapes,CseSnapshotMessageinvariants, optional fields onCseSnapshot,CseSerializedValue,CseSerializedInstruction,CseSerializedEnvFrame, andCseSerializedBindingrunner(2 → 13 tests): plugin identity, constructor error handling,sendSnapshotsmessage shape,totalStepsaccuracy, empty/large batches, field preservationweb(5 → 26 tests): plugin identity, constructor error handling, valid message delivery, ordering, field preservation, invalid/malformed message rejection (wrong type, null, undefined, non-array snapshots,totalStepsmismatch, missing fields), re-export contractTest plan
yarn testpasses with all 61 tests green