# How to Run Tests for the Corsair Project: A Complete Guide

> Learn how to run tests for the Corsair project efficiently. Use simple pnpm commands to execute the full test suite or target specific plugins in the corsairdev/corsair repository.

- Repository: [corsairdev/corsair](https://github.com/corsairdev/corsair)
- Tags: how-to-guide
- Published: 2026-09-01

---

**Use `pnpm test` in the repository root to run the full test suite, or `pnpm --filter @corsair-dev/<plugin> test` to target a specific plugin.**

The **Corsair** monorepo is a collection of more than 150 plugins for integrating external APIs into LLM applications. Learning how to run tests for the Corsair project efficiently requires understanding its **PNPM workspace** and **Turbo** orchestration setup. This guide covers commands for running the full suite, individual plugins, and understanding the live versus offline test behavior.

## Run the Full Test Suite

The simplest way to run tests for the Corsair project is from the repository root:

```bash
pnpm test

```

This command executes the `test` script defined in [`package.json`](https://github.com/corsairdev/corsair/blob/main/package.json) at the project root. According to the source code, this script runs `turbo --filter "./packages/*" test`【/cache/repos/github.com/corsairdev/corsair/main/package.json†L13-L14】. Turbo then discovers every package under `packages/` and invokes that package's own `test` script in parallel where possible.

This approach ensures comprehensive coverage across all plugins while leveraging Turbo's caching to skip unchanged packages.

## Run Tests for a Single Plugin

For focused development, target individual plugins using PNPM's `--filter` flag with the package name from each plugin's [`package.json`](https://github.com/corsairdev/corsair/blob/main/package.json):

```bash

# OpenAI plugin tests

pnpm --filter @corsair-dev/openai test

# Webflow plugin tests

pnpm --filter @corsair-dev/webflow test

# Pinecone plugin tests

pnpm --filter @corsair-dev/pinecone test

```

Each plugin defines its own test command. Most use **Jest** as the test runner. For example, the OpenAI plugin's [`package.json`](https://github.com/corsairdev/corsair/blob/main/package.json) specifies `"name": "@corsair-dev/openai"` with a test script of `"test": "jest"`【/cache/repos/github.com/corsairdev/corsair/main/packages/openai/README.md†L1-L4】.

Filter commands are essential when iterating on a single plugin, avoiding the overhead of running 150+ test suites.

## Run Explorer Component Tests

The **Explorer** is a standalone HTTP catalog component with its own package structure:

```bash
cd explorer
pnpm test

```

The Explorer's [`package.json`](https://github.com/corsairdev/corsair/blob/main/package.json) lives at [`explorer/package.json`](https://github.com/corsairdev/corsair/blob/main/explorer/package.json)【/cache/repos/github.com/corsairdev/corsair/main/explorer/package.json†L1-L9】. Note that test scripts may need to be added for future Explorer-specific validation; currently the directory focuses on build and start operations.

To build and run the Explorer locally:

```bash
cd explorer
pnpm build
pnpm start

```

## Understand Live vs. Offline Tests

Corsair plugins implement a **two-tier testing strategy** to protect CI pipelines and local development.

### Offline Schema Tests

- Run by default with no configuration
- Validate JSON schemas, TypeScript types, and mock data
- Always execute in `pnpm test` runs

### Live API Tests

- Require environment variables with actual API credentials
- Automatically **skipped** when credentials are absent
- Example: `OPENAI_API_KEY` enables live OpenAI plugin tests

The OpenAI README documents this behavior explicitly: tests check for the presence of required environment variables and skip live validation when missing【/cache/repos/github.com/corsairdev/corsair/main/packages/openai/README.md†L104-L112】.

## Run Tests in CI Pipelines

Continuous integration uses the same root command:

```bash
pnpm test

```

This standardized approach ensures CI and local environments behave identically. The credential-safe default (offline tests only) prevents flaky failures from external service outages or rate limits.

## Complete Command Reference

| Scenario | Command |
|----------|---------|
| Full monorepo suite | `pnpm test` |
| Single plugin (OpenAI) | `pnpm --filter @corsair-dev/openai test` |
| Single plugin (Webflow) | `pnpm --filter @corsair-dev/webflow test` |
| With live tests enabled | `OPENAI_API_KEY=xxx pnpm --filter @corsair-dev/openai test` |
| Explorer build + start | `cd explorer && pnpm build && pnpm start` |

## How the Test Architecture Works

Three design decisions enable efficient test execution in the Corsair project:

1. **Monorepo structure** — All plugins reside under `packages/`. Turbo filters by glob patterns to isolate test execution without cross-package interference.

2. **Unified tooling** — PNPM workspaces provide consistent command interfaces. Whether running one plugin or 150, the same `pnpm` commands apply.

3. **Credential isolation** — Environment-gated live tests keep secrets out of repository code and prevent CI failures from external API instability.

## Summary

- Run `pnpm test` from the repository root to execute all plugin tests via Turbo
- Use `pnpm --filter @corsair-dev/<name> test` for single-plugin testing
- Offline tests run by default; live tests require specific environment variables
- The Explorer component operates as a separate package in the `explorer/` directory
- CI pipelines use identical commands to local development for reproducibility

## Frequently Asked Questions

### What test runner does Corsair use for plugins?

Most plugins use **Jest** as the test runner. Individual plugin [`package.json`](https://github.com/corsairdev/corsair/blob/main/package.json) files define `"test": "jest"` or variant commands. The specific configuration varies by plugin needs, but Jest provides the underlying framework across the monorepo.

### Why do some tests skip automatically when I run `pnpm test`?

Live tests that call actual external APIs skip when required credentials are absent. This is intentional design—offline schema tests always run, while live validation only executes when you've explicitly provided API keys via environment variables. Check plugin README files for the specific variables each integration requires.

### Can I run tests in parallel or with caching?

Turbo handles parallelization and caching automatically when you run `pnpm test`. Turbo's task pipeline executes independent test suites concurrently and caches results for packages without code changes. For single-plugin runs, standard Jest parallelism applies based on that plugin's configuration.

### How do I add tests for a new plugin I'm building?

Create a `test` script in your plugin's [`package.json`](https://github.com/corsairdev/corsair/blob/main/package.json) pointing to your test runner. Follow the naming convention `@corsair-dev/<your-plugin>` so the `--filter` flag works correctly. Include offline tests for schemas and types, and gate any live API tests behind environment variable checks to maintain CI safety.