Skip to content

feat: add test suite (96 tests) and GitHub Actions CI workflow#400

Open
East-rayyy wants to merge 6 commits into
decolua:masterfrom
East-rayyy:feat/test-suite-and-ci
Open

feat: add test suite (96 tests) and GitHub Actions CI workflow#400
East-rayyy wants to merge 6 commits into
decolua:masterfrom
East-rayyy:feat/test-suite-and-ci

Conversation

@East-rayyy

@East-rayyy East-rayyy commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Problem

No CI runs on PRs — a broken build or failing test can slip through without anyone noticing until it ships. The existing test suite also had 2 outdated test files that fail on current master.

What this adds

  • GitHub Actions CI (.github/workflows/ci.yml) — runs on every PR to master
    • Tests on Node 20 + 22
    • Build verification
    • ESLint (errors show as inline annotations in the PR diff)
  • 96 new unit tests covering previously untested areas:
    • Request/response translators (openai↔claude, gemini↔openai)
    • Format detection (detectFormatByEndpoint)
    • Data directory resolution (DATA_DIR, XDG_CONFIG_HOME)
    • Provider model list validation
  • Fixed 2 pre-existing test files that were written for older code
  • Cleaned up test infra — vitest as root devDep, removed /tmp hack

Lint note

The lint job fails due to pre-existing issues in the codebase (React hooks, setState in effects). Not introduced by this PR. Happy to fix in a follow-up.


@decolua — what do you think about having CI on PRs? If you like this direction I can also add the lint fixes as a separate PR so the whole pipeline goes green. Let me know if you'd prefer a different setup or if testing isn't a priority right now.

- Add vitest as root devDependency, add test/test:ci scripts
- Remove NODE_PATH=/tmp/node_modules hack from tests/package.json
- Add 5 new test files (96 tests total):
  - translator-request: openaiToClaudeRequest role mapping, tools, thinking
  - translator-response: claudeToOpenAI + geminiToOpenAI streaming chunks
  - format-detection: detectFormatByEndpoint for /v1/responses, chat/completions
  - data-dir: getUserDataDir DATA_DIR, XDG_CONFIG_HOME, platform defaults
  - provider-models: PROVIDER_MODELS structure, helpers (getProviderModels, etc.)
- Add GitHub Actions CI workflow (test on Node 20+22, build, lint)
The commenting/reporting needs write permissions which fork PRs
don't get. Split into:
- ci.yml: runs tests/build/lint (works for all PRs)
- ci-report.yml: posts results comment via workflow_run (runs in
  base repo context with write permissions)
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