Skip to content

Run UI unit tests in CI#25792

Merged
Hona merged 1 commit intoanomalyco:devfrom
Hona:fix/ui-unit-tests-ci
May 5, 2026
Merged

Run UI unit tests in CI#25792
Hona merged 1 commit intoanomalyco:devfrom
Hona:fix/ui-unit-tests-ci

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented May 5, 2026

Summary

  • preserve final newline semantics when reconstructing file contents from unified patches for UI diffs
  • add coverage for \ No newline at end of file markers
  • wire @opencode-ai/ui unit tests into the existing bun turbo test:ci unit matrix

Tests

  • bun test src in packages/ui
  • bun typecheck in packages/ui
  • bun turbo test:ci --filter=@opencode-ai/app --filter=@opencode-ai/ui
  • push hook: bun turbo typecheck

Note: .opencode/opencode.jsonc remains an unrelated local change and is not included.

Copilot AI review requested due to automatic review settings May 5, 2026 00:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the UI unified-diff normalization logic so reconstructed “before/after” file contents preserve end-of-file newline semantics (including \ No newline at end of file markers), and wires @opencode-ai/ui unit tests into the repo’s existing bun turbo test:ci CI execution/reporting flow.

Changes:

  • Preserve missing-final-newline semantics when rebuilding file contents from unified patches in session-diff.ts.
  • Add a unit test covering \ No newline at end of file handling.
  • Add test / test:ci scripts for @opencode-ai/ui and register Turbo task overrides so CI can execute and publish JUnit results.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
turbo.json Adds Turbo task overrides for @opencode-ai/ui test and test:ci (with JUnit outputs).
packages/ui/src/components/session-diff.ts Tracks per-line newline presence and applies \ No newline at end of file markers when reconstructing before/after content.
packages/ui/src/components/session-diff.test.ts Adds coverage to ensure missing final newline markers are preserved in UI diff text output.
packages/ui/package.json Introduces test and test:ci scripts (including JUnit reporter output) for CI integration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hona Hona changed the title fix(ui): preserve unified diff final newlines Run UI unit tests in CI May 5, 2026
@Hona Hona merged commit ca2411d into anomalyco:dev May 5, 2026
17 checks passed
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.

2 participants