# AetherForge Test Suite

One command runs everything:

```bat
test.bat
```

Or with PowerShell directly:

```powershell
.\scripts\test-suite.ps1
```

## Phases

| Phase | What it runs | Location |
|-------|----------------|----------|
| 1 | Go server unit + integration tests | `server/` |
| 2 | Go agent tests | `agent/` |
| 3 | Fusion module compile check | `fusion/` |
| 4 | Frontend unit tests (Vitest) | `server/web/` |
| 5 | Frontend production build | `server/web/` |
| 6 | Server binary compile | `server/` |
| 7 | Agent binary compile | `agent/` |
| 8 | E2E smoke (Playwright) | `server/web/e2e/` — starts temp server |

## Run individual suites

```bat
cd server && go test ./...
cd agent && go test ./...
cd server\web && npm test
cd server\web && npm run test:e2e
```

## E2E only (server already running)

```bat
set AETHERFORGE_URL=http://127.0.0.1:8989
cd server\web && npm run test:e2e
```

## Adding tests

- **Go:** `*_test.go` next to the code under test
- **Frontend:** `src/**/*.test.ts` (Vitest)
- **E2E:** `server/web/e2e/*.spec.ts` (Playwright)

Coverage areas: forge/fusion, auth, DB, pool reconnect, API routes, fleet filters, preflight validation, media crypto roundtrip, dashboard login smoke.
