Skip to content

test: expand CSE machine test coverage to 61 tests#45

Merged
Akshay-2007-1 merged 3 commits into
mainfrom
test/cse-machine
Jun 27, 2026
Merged

test: expand CSE machine test coverage to 61 tests#45
Akshay-2007-1 merged 3 commits into
mainfrom
test/cse-machine

Conversation

@Akshay-2007-1

Copy link
Copy Markdown
Contributor

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, CseSnapshotMessage invariants, optional fields on CseSnapshot, CseSerializedValue, CseSerializedInstruction, CseSerializedEnvFrame, and CseSerializedBinding
  • runner (2 → 13 tests): plugin identity, constructor error handling, sendSnapshots message shape, totalSteps accuracy, empty/large batches, field preservation
  • web (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, totalSteps mismatch, missing fields), re-export contract

Test plan

  • yarn test passes with all 61 tests green
  • No source files modified

@changeset-bot

changeset-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d39e489

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/common/cse-machine/src/__tests__/common.test.ts Outdated
Comment thread src/runner/cse-machine/src/__tests__/runner.test.ts
Comment thread src/runner/cse-machine/src/__tests__/runner.test.ts Outdated
Comment thread src/runner/cse-machine/src/__tests__/runner.test.ts Outdated
Comment thread src/runner/cse-machine/src/__tests__/runner.test.ts Outdated
Comment thread src/runner/cse-machine/src/__tests__/runner.test.ts Outdated
Comment thread src/runner/cse-machine/src/__tests__/runner.test.ts Outdated
Comment thread src/runner/cse-machine/src/__tests__/runner.test.ts Outdated
@Akshay-2007-1 Akshay-2007-1 merged commit 5276ee7 into main Jun 27, 2026
2 checks passed
@Akshay-2007-1 Akshay-2007-1 deleted the test/cse-machine branch June 27, 2026 11:55
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