You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.MD
+27-14Lines changed: 27 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,25 @@ OpenCode plugin for Google Antigravity OAuth. Intercepts `fetch()` calls to `gen
12
12
bun install # Install dependencies
13
13
bun run build # Compile (tsc -p tsconfig.build.json)
14
14
bun run typecheck # Type-check only (tsc --noEmit)
15
-
bun run test# Run all tests (vitest run)
16
-
bunx vitest run src/plugin/auth.test.ts # Single test file
17
-
bunx vitest run -t "test name here"# Single test by name
18
-
bunx vitest --watch src/plugin/auth.test.ts # Watch mode, single file
19
-
bun run --cwd packages/opencode test:coverage # Coverage report
20
-
bun run --cwd packages/opencode test:e2e:models # E2E: model availability check
21
-
bun run --cwd packages/opencode test:e2e:regression # E2E: regression suite
15
+
bun run test# Run all unit tests (bun test --isolate across packages)
16
+
bun test --isolate src/plugin/auth.test.ts # Single test file
17
+
bun test --isolate -t "test name here"# Single test by name (uses bun:test's -t filter)
18
+
bun test --isolate --watch src/plugin/auth.test.ts # Watch mode, single file
19
+
bun run test:e2e # Deterministic e2e flows (mock Antigravity server, no network)
20
+
bun run test:e2e:models # Live Antigravity model inventory (CI-gated, network)
21
+
bun run test:e2e:regression # Cross-model + Gemini CLI regression (network)
22
+
bun run --cwd packages/opencode smoke:tui # Pack-and-install smoke test for the TUI subpath
22
23
```
23
24
24
-
No linter or formatter is configured. Style is enforced by convention (see below).
25
+
Format and lint via Biome:
26
+
27
+
```bash
28
+
bun run format # biome format --write .
29
+
bun run format:check # biome format . (CI gate)
30
+
bun run lint # biome lint . (CI gate)
31
+
```
32
+
33
+
Pre-commit hooks (`.lefthook.yml`) run Biome on changed `*.{ts,tsx,js,mjs,json,jsonc,yml,yaml}` files via `bunx biome check --staged --no-errors-on-unmatched`. The repo pins the toolchain in `mise.toml` (`bun = "1.3"`, `node = "24"`) and CI uses `oven-sh/setup-bun@v2` with `bun-version: 1.3`.
25
34
26
35
## TypeScript Configuration
27
36
@@ -70,7 +79,7 @@ No linter or formatter is configured. Style is enforced by convention (see below
70
79
71
80
### Formatting
72
81
- 2-space indentation
73
-
-Double quotes for strings
82
+
-Single quotes for strings (Biome `quoteStyle: single`)
74
83
- Trailing commas in multiline constructs
75
84
- No semicolons (project convention)
76
85
@@ -130,15 +139,19 @@ Per-account device fingerprints stored in `antigravity-accounts.json`. Each fing
130
139
131
140
## Testing
132
141
133
-
- Framework: **Vitest 3**with native ESM
134
-
- Config: `vitest.config.ts`
135
-
- Tests colocated: `src/plugin/foo.test.ts` next to `src/plugin/foo.ts`
136
-
- Use `describe`/`it`/`expect`— standard Vitest API
137
-
- Mock with `vi.fn()`, `vi.spyOn()`, `vi.mock()`
142
+
- Framework: **Bun's test runner**(`bun test`; the `bun:test` module re-exports a jest-compatible namespace)
143
+
- Config: no per-package config — Bun discovers `*.test.ts` next to source. The `bunfig.toml` at the root and in each workspace preloads `test/setup.ts` (env-isolation + a per-test mkdtemp root + a `globalThis.stubbed` / `unstubAllGlobals` / `freshImport` helper). The e2e workspace uses `bunfig.toml``root = "./src"` so its tests stay isolated from the unit workspace.
144
+
- Tests colocated: `src/plugin/foo.test.ts` next to `src/plugin/foo.ts`. The e2e workspace uses `*.e2e.test.ts` so the root `bun run test` and `bun run test:e2e` selectors can target them precisely.
145
+
- Use `describe`/`it`/`expect`from `bun:test` — the standard API.
146
+
- Mock with `mock()`, `spyOn()`, and the `jest` namespace exported from `bun:test` (`jest.fn`, `jest.spyOn`, `jest.setSystemTime`, etc.). The `test/setup.ts` preload patches `jest.setSystemTime` / `jest.useRealTimers` so they also spy on `Date.now()` (Bun's `bun:test` clock only fakes the timer queue, not the wall clock).
0 commit comments