Test Runners
Hone uses per-package test runners. There is no monorepo-level test command — each package must be tested independently.
Test Matrix
| Package | Runner | Command | Test Count | Import |
|---|---|---|---|---|
| hone-core | Bun | bun test | 649+ | import { describe, it, expect } from 'bun:test' |
| hone-editor | Bun | bun test | 353 | import { describe, it, expect } from 'bun:test' |
| hone-terminal | Bun | bun test | 163 | import { describe, it, expect } from 'bun:test' |
| hone-relay | Bun | bun test | 48 | import { describe, it, expect } from 'bun:test' |
| hone-build | Bun | bun test | 21 | import { describe, it, expect } from 'bun:test' |
| hone-themes | Jest | npm test | 452 | import { describe, it, expect } from '@jest/globals' |
| hone-extensions | Vitest | npm test | — | import { describe, it, expect } from 'vitest' |
| hone-api | tsc | npm test | — | (type-check only, no runtime tests) |
Running Tests
All tests in a package
cd hone-core && bun test
cd hone-editor && bun test
cd hone-terminal && bun test
cd hone-relay && bun test
cd hone-build && bun test
cd hone-themes && npm test
cd hone-extensions && npm test
cd hone-api && npm test
A single test file
cd hone-editor && bun test tests/buffer.test.ts
With Bun, pass the file path as an argument. Bun matches on filename, so partial names also work:
bun test buffer # runs all test files containing "buffer" in the name
Type checking
cd <package> && bun run typecheck
# or
npx tsc --noEmit
Important: Use the Correct Runner
The runner matters. Do not use npx vitest or npx jest in Bun-based packages — they will fail because test files import from bun:test, which only Bun provides.
| If the test file imports from… | Use this runner |
|---|---|
bun:test | bun test |
@jest/globals or no import (Jest globals) | npm test (Jest) |
vitest | npm test (Vitest) |
Writing Tests (Bun Packages)
import { describe, it, expect, beforeEach } from 'bun:test';
describe('PieceTable', () => {
let table: PieceTable;
beforeEach(() => {
table = new PieceTable('hello world');
});
it('should insert text', () => {
table.insert(5, ' beautiful');
expect(table.getText()).toBe('hello beautiful world');
});
it('should delete text', () => {
table.delete(5, 6);
expect(table.getText()).toBe('hello');
});
});
What Each Package Tests
| Package | Coverage Areas |
|---|---|
| hone-core | Workspace management, settings, git integration, search, LSP client, DAP client, AI service, extension host |
| hone-editor | Piece table buffer, multi-cursor editing, undo/redo, viewport calculations, tokenizer, search & replace, code folding, diff algorithm, LSP integration, DAP integration |
| hone-terminal | VT100/VT220 escape sequence parser, terminal buffer, keyboard input handling, terminal emulator integration |
| hone-relay | Token authentication, message buffering, WebSocket hub, configuration parsing |
| hone-build | Artifact storage, platform target normalization |
| hone-themes | JSON schema validation for all 11 themes, WCAG contrast ratio compliance |
| hone-extensions | Built-in extension functionality |
| hone-api | Type correctness of the public extension API (compile-time only) |