Skip to content

Test files import vitest but vitest is not installed and no test script exists — the suite has never run #60

Description

@yakimoto

src/__tests__/ contains three test files — AgentLogger.test.ts, AgentRuntime.test.ts, adapters.test.ts — that all import { describe, it, expect, vi } from 'vitest'.

None of them can run.

Check Result
vitest in package.json devDependencies absent
vitest in package-lock.json grep -c '"node_modules/vitest"'0
test script in package.json absent
Test dir in tsconfig.json excluded ("exclude": [..., "src/**/__tests__/**", "src/**/*.test.ts"])
Test step in .github/workflows/lint.yml absent — the job runs npm ci, npm run lint, npm run type-check

So the repo's entire gate is lint + type-check + the shared foundation checks (secret scan, file-size, skill frontmatter, route naming). No behaviour is verified anywhere.

Why this is worse than having no tests

Test files that exist but never execute are actively misleading. .wave/repo.json asserted that the toolkits and adapters "are covered by tests" — that claim was false and I removed it in #58. Anyone reading src/__tests__/ reasonably concludes there is a safety net.

And it has already cost something concrete: #59 fixes two LangGraph graph-node factories that looked up tools by names that do not exist, so they returned {"error":"... tool not found"} on every single invocation and never made a network call. That shipped in a published npm package. A running test suite that invoked those factories once would have caught it immediately.

What "done" looks like

  • Add vitest to devDependencies and a "test": "vitest run" script
  • Stop excluding the test directory from tsconfig.json, or give tests their own tsconfig — as it stands the test files are not even type-checked
  • Add npm test to .github/workflows/lint.yml (or a dedicated workflow)
  • Confirm the three existing test files actually pass — they have never been executed, so some may be stale. adapters.test.ts asserts tools.length === 10, which feat(tools): fleet, dispatch and payment toolkits (#72) #58 does not change (AgentToolkit still returns 10), but that needs verifying rather than assuming
  • Cover the graph-node factories from fix(langgraph): graph nodes look up tools by the wrong names and always fail #59, which are exactly the code path the current tests miss

Related: wave-av/mcp-server#64 (same gap, that repo has no test files at all). Surfaced while building wave-av/wave-context#72.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageOn the board but missing Type/Area/Priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions