Skip to content
Agent Workspaces
Agent

testing

All paths are relative to `apps/emdash-desktop/`.

From plugin
emdash
6.2k33 skills33 agents

Agent definition

testing.md

Testing And Validation

All paths are relative to `apps/emdash-desktop/`.

Core Local Gate

Run these before merging (from the repo root or `apps/emdash-desktop/`):

pnpm run format
pnpm run lint
pnpm run typecheck
pnpm run test

Test Commands

`pnpm test` at the repository root runs every package's default test suite. Inside an app or package directory it runs only that package's suite. From the root, `pnpm --filter @emdash/plugins test` runs only the selected package's suite. All three routes use Nx to prepare required builds automatically; dependency builds do not cause dependency tests to run. Nx is installed by `pnpm install`.

Pass test-file paths or Vitest options after `test --`, for example `pnpm --filter @emdash/emdash-desktop test -- --project scripts`. The separator prevents Nx from consuming flags that both tools recognize, such as `--project`. Direct `pnpm exec vitest` is an advanced debugging escape hatch that bypasses prerequisite preparation.

Existing suite boundaries remain unchanged: fixture generation, performance measurements, benchmarks, and the opt-in remote integration flow remain explicit commands. Specialized test commands also prepare prerequisite builds. Watch and other specialized test targets do not cache their results, while their builds can use the Nx cache.

Test Layout

  • main-process tests: colocated in `src/main/core/**/*.test.ts`
  • renderer unit tests: `src/renderer/tests/`
  • renderer browser tests: `src/renderer/tests/browser/` (run via Playwright)

Current Setup

  • Vitest config is in `vitest.config.ts` (separate from the build config in `electron.vite.config.ts`).
  • Six test projects:
  • `node` — `src/**/*.test.ts` excluding `_*` dirs, browser tests, migration tests, `*.db.test.ts`, and `src/main/db/legacy-port/**/*.test.ts`
  • `main-db` — `src/main/core/**/*.db.test.ts` and `src/main/db/legacy-port/**/*.test.ts` against real SQLite
  • `fixtures` — fixture generator, run via `pnpm run db:fixtures`
  • `migrations` — `src/main/db/tests/migrations/**`, run via `pnpm run test:migrations`
  • `scripts` — release, support, and developer-command tests under `scripts/`
  • `browser` — `src/renderer/tests/browser/**/*.test.{ts,tsx}` via Playwright
  • `pnpm run test` runs every project except `fixtures` (`node`, `main-db`,

`migrations`, `scripts`, and `browser`). Setting `EMDASH_TEST_SKIP_BROWSER=1` omits the Playwright-backed `browser` project locally; CI omits it automatically.

  • Tests use per-file `vi.mock()` setup.
  • Integration-style tests create temporary repos and worktrees in `os.tmpdir()`.
  • `tooling/vitest/setup-isolated-home.mjs` (repo root) gives every test file in the app's `node`,

`main-db`, `fixtures`, and `migrations` projects, `@emdash/core`, and `@emdash/workspace-server` its own empty `HOME` with a minimal global git config, drops inherited `GIT_*` and XDG home variables, and on Windows moves `APPDATA` and `LOCALAPPDATA` into that home (`isolateHomeEnv` in `tooling/vitest/isolated-home.mjs`). Tests there never see the developer's git config or write to `~/.emdash`, `~/.ssh`, and the like. A test that is about home-directory behavior builds its own environment. The app's `scripts` project and `@emdash/plugins` run the real pnpm/Nx toolchain and keep the developer's home.

CI Notes

  • `.github/workflows/code-consistency-check.yml` uses `nx affected` to enforce

format:check, typecheck, lint, and test only for projects touched by the PR. Nx computes the affected set using `nrwl/nx-set-shas` and the PR base/head SHAs.

  • CI installs with `--ignore-scripts`, so the workflow explicitly installs the

native side project (`pnpm --dir apps/emdash-desktop/tooling/node-deps install`) for the DB-backed Vitest projects. It also rebuilds and load-checks `node-pty` from `@emdash/core`, a workspace that declares the dependency. Vitest omits the Playwright-backed `browser` projects (app and chat-ui) when it detects CI until browser provisioning is proven stable there.

  • The full suite (including `browser` projects) is still expected locally before merging.

Focused Validation

  • after IPC/RPC changes: rerun the affected Vitest file and confirm the controller is wired in `src/main/rpc.ts`
  • after worktree or PTY changes: rerun the closest `src/main/core/` test files
  • after schema changes: run `pnpm run db:fixtures` and `pnpm run test:migrations`
Read more
@generalaction
Ships withemdash

Emdash is the Open-Source Agentic Development Environment (🧡 YC W26). Run multiple coding agents in parallel. Use any provider.

Stars on GitHub

Momentum

stars in total
6.2k
Star history of generalaction/emdash on GitHub, a chart by star-history.com

Other agents on emdash.

acp-runtime

acp-runtime

Agent

The ACP runtime is the domain service that serves the ACP API contract. It owns the host-scoped dependencies needed to run…

core-modules

core-modules

Agent

This page defines the target organization of `packages/core/src/`. Core is organized by module type so that shared domain APIs…

git-runtime

git-runtime

Agent

Git is split into a transport contract and a host-scoped runtime. Renderer, desktop, and workspace-server code share the Wire…

main-process

main-process

Agent

The main process is organized into domain modules under `src/main/core/`. Each domain typically has a `controller.ts` (RPC…

path-system

path-system

Agent

`@emdash/core/primitives/path/api` is the source of truth for portable file identity and lexical path operations. The detailed…

More agents from other plugins.

api-builder

api-builder

Agent

Deprecated placeholder. Do not use; follow root AGENTS.md and package instructions instead.

happier2d2.2k
@happier-dev@happier-devInstall Agent

Questions about testing.

Which coding agents can use testing?
testing installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.