Skip to content

Fix connection tests so pnpm test can run outside Tauri runtime #36

@htazq

Description

@htazq

Problem

Running pnpm test in the normal Vitest/jsdom environment fails in src/__tests__/connection.test.ts because the tests directly call @tauri-apps/api/core.invoke without a Tauri runtime.

Observed failure:

TypeError: Cannot read properties of undefined (reading 'invoke')

The remaining suite can pass, but these seven tests make the full frontend test command fail outside the Tauri app context.

Expected

Connection tests should either:

  • mock @tauri-apps/api/core.invoke with deterministic responses, or
  • be moved to an integration/e2e test command that runs inside a Tauri-capable environment, or
  • be skipped unless the required Tauri runtime/test fixture is available.

Why this matters

PR validation should be able to distinguish real regressions from environment-dependent integration tests. During PR #34 validation, pnpm test reported 425/432 passing tests and only these seven Tauri invoke failures.

Reproduction

pnpm install
pnpm test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions