---
title: "Testing"
description: "How the pi-extension test suite is organized and run."
---

# Testing

The `pi-extensions/` directory includes a test suite for the extensions.
Tests are co-located with the extensions they test, each in a `tests/` subdirectory.

## Test organization

```text
pi-extensions/
├── anytype/
│   └── tests/anytype.test.ts
├── anytype-tree-view/
│   └── tests/anytype-tree-view.e2e.ts
├── application-assistant/
│   └── application-assistant.test.ts
├── azure/
│   └── tests/azure.test.ts
├── credential-leak/
│   └── tests/credential-leak.test.ts
├── curl/
│   └── tests/
│       ├── curl.test.ts
│       ├── curl.integration.test.ts
│       ├── curl.path-helpers.test.ts
│       └── curl.simple.test.ts
├── engine-gate/
│   └── index.test.ts
├── integration-layer/
│   └── tests/integration.test.ts
└── scripts/
    └── test-all.test.ts
```

Test conventions: files follow `*.test.ts`, import the main extension via `../index.ts`, and use the shared Vitest configuration in `pi-extensions/curl/tests/vitest.config.ts`.

## Running the tests

From the `pi-extensions/` directory:

```bash
# all tests
bun test

# run the unified runner
bun test scripts/test-all.test.ts
```

`pi-extensions/package.json` defines the test scripts.
The curl and anytype suites run under Vitest; the runner is configured there.

Curl-specific test details and a Bun-equivalent guide live in `pi-extensions/docs/TESTING.md` and `pi-extensions/docs/TESTING_BUN.md`.

## CI considerations

The suite is designed to run fast with no external dependencies: all API calls are mocked and tests finish in well under a second.
The `bun-test` prek hook in `prek.toml` runs them on every commit.
