58 lines
1.1 KiB
Markdown

# pi-test-status
A [Pi](https://pi.dev) extension that watches for test runs and shows a pass/fail widget in the Pi UI.
## Features
- Detects `vitest` and `npm test` commands in bash tool calls
- Parses vitest output to determine pass/fail status
- Shows a live widget indicator (● green for pass, ● red for fail)
- Displays the summary line from the test output
## Installation
```bash
pi install npm:pi-test-status
```
Or with a scope:
```bash
pi install npm:@your-scope/pi-test-status
```
## Development
```bash
pi -e ./extensions/index.ts
```
Or from the package root:
```bash
pi -e .
```
## Usage
Once installed, the extension automatically activates when you run tests:
```bash
# In Pi, just run your tests — the widget appears automatically
npm test
npx vitest
vitest run
```
The widget shows:
- Green ● with summary on test pass
- Red ● with summary on test failure
## How it works
The extension subscribes to the `tool_result` event. When a bash tool call matches a test command, it parses the vitest output for pass/fail indicators and updates a Pi widget with the result.
## License
MIT