Skip to content

Plugin Testing Setup Guide

How to set up testing for an OpenPets pet with minimal configuration.

TL;DR

Use the repo-level pet harness from the OpenPets workspace root:

bash
bun test:pet <pet-name> --query "test connection"
bun test:pet <pet-name> --query "list items" --follow "show the first item"
bun run test:pet -- <pet-name> --cases pets/<pet-name>/test-cases.json

Package Metadata

Each pet should keep realistic queries and scenarios in package.json:

json
{
  "queries": [
    "test connection",
    "list recent items"
  ],
  "scenarios": {
    "basic-workflow": [
      "test connection",
      "list recent items",
      "show the first item"
    ]
  }
}

Direct Tool Checks

Use direct tool calls for tight implementation loops:

bash
pets tools <pet-name>
pets exec <pet-name>-test-connection --args '{}' --json

Pet packages do not need local scripts for the common harness. If a package needs shortcuts, keep them thin wrappers around bun run test:pet from the repo root.