How to Run Tests in the OpenWork Project: Complete Monorepo Testing Guide

Run pnpm test from the repository root to execute the full test suite, or use specific filtered commands like pnpm test:e2e and pnpm test:health to target individual workspaces.

The OpenWork project by different-ai is a pnpm-powered monorepo that aggregates test scripts across multiple workspaces. Understanding how to run tests in the OpenWork project requires familiarity with its root-level orchestration in dev/package.json and the filtered workspace commands that delegate to specific packages.

Understanding the OpenWork Test Architecture

OpenWork uses pnpm as its package manager and defines a comprehensive test suite across several workspaces. The main entry point is the root dev/package.json, which aggregates test scripts that delegate to individual packages using pnpm's filtering feature (pnpm --filter <workspace>).

Each script in the root configuration targets a specific concern—from health checks to end-to-end UI validation—allowing developers to run granular tests without executing the entire suite.

Running the Complete Test Suite

To verify code correctness across the entire monorepo, use the default test script defined in dev/package.json:


# Install dependencies first

pnpm install

# Run every test in the monorepo

pnpm test

This command executes all test scripts defined in the workspace, covering unit, integration, and end-to-end tests. The same commands are used in GitHub Actions workflows, ensuring local and CI parity.

Targeted Testing by Workspace

For faster feedback during development, run specific test categories using the filtered scripts defined in the root package.json.

Application Health and Session Tests

Health checks validate the core application's readiness:

pnpm test:health

Session-related tests verify authentication and state handling:

pnpm test:sessions
pnpm test:session-error-recovery
pnpm test:session-scope
pnpm test:session-switch

Feature-Specific Test Suites

Target specific functional areas using dedicated scripts:

  • pnpm test:refactor – Ensures refactor-related functionality works as expected
  • pnpm test:events – Tests the internal event bus implementation
  • pnpm test:todos – Validates todo-management logic
  • pnpm test:permissions – Checks permission enforcement mechanisms
  • pnpm test:fs-engine – Verifies the virtual file-system implementation
  • pnpm test:eval-runner – Runs the evaluator that drives test specifications

End-to-End and Enterprise Testing

Execute the full UI/desktop e2e suite via the @openwork/app workspace:

pnpm test:e2e

For large-scale admin validation in the Den API (@openwork-ee/den-api), run:

pnpm test:admin-scale

Evaluation Testkit

Run the low-level testkit specifications used for spec-driven testing:

pnpm evals:test

This command executes node --test against files in evals/runner/*.test.ts and evals/packages/*/test/*.test.ts as configured in evals/package.json.

Package-Specific Test Commands

Individual packages expose their own test scripts for isolated development. Navigate to a specific package or use pnpm filters to execute these directly.

Handsfree Package

In packages/handsfree/package.json, the test suite includes:


# From the package directory

cd packages/handsfree
pnpm test:e2e

This runs the handsfree-specific end-to-end checks alongside check:js scripts.

Bootstrap Package

The packages/openwork-bootstrap/package.json uses a simple Node.js test runner:

cd packages/openwork-bootstrap
node test/openwork-bootstrap.test.mjs

Enterprise MCP Client

For the enterprise MCP client in packages/enterprise-mcp-client/package.json:

cd packages/enterprise-mcp-client
pnpm test

This executes tsx --test test/*.test.ts to validate the client implementation.

Summary

  • Use pnpm test from the repository root to execute the complete test suite across all workspaces.
  • Target specific functionality with filtered commands like pnpm test:e2e, pnpm test:health, or pnpm test:admin-scale.
  • Run package-level tests by navigating to directories like packages/handsfree/ or using pnpm --filter <workspace> test.
  • Execute evaluation specs using pnpm evals:test for the low-level testkit in the evals/ directory.
  • Reference dev/package.json as the central orchestrator for all test commands in the OpenWork monorepo.

Frequently Asked Questions

What package manager does OpenWork use for testing?

OpenWork uses pnpm exclusively. All test scripts are defined in dev/package.json and use pnpm's workspace filtering capabilities (--filter) to delegate commands to specific packages like @openwork/app or @openwork-ee/den-api.

How do I run only the end-to-end tests?

Execute pnpm test:e2e from the repository root. This command runs pnpm --filter @openwork/app test:e2e according to the script definition in dev/package.json, executing the full UI/desktop e2e suite without running unit or integration tests.

Where are the test scripts defined in the OpenWork repository?

The root test orchestrator is dev/package.json, which contains scripts for test:health, test:sessions, test:e2e, and other categories. Individual packages like packages/handsfree/package.json and packages/enterprise-mcp-client/package.json define their own specific test implementations that the root scripts reference via pnpm filters.

Can I run tests for a single package without filters?

Yes. Navigate directly to the package directory (for example, cd packages/handsfree) and run pnpm test or pnpm test:e2e depending on what that specific package.json exposes. Alternatively, use pnpm's filter syntax from the root: pnpm --filter @openwork/handsfree test.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →