Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Test Runners

Hone uses per-package test runners. There is no monorepo-level test command — each package must be tested independently.

Test Matrix

PackageRunnerCommandTest CountImport
hone-coreBunbun test649+import { describe, it, expect } from 'bun:test'
hone-editorBunbun test353import { describe, it, expect } from 'bun:test'
hone-terminalBunbun test163import { describe, it, expect } from 'bun:test'
hone-relayBunbun test48import { describe, it, expect } from 'bun:test'
hone-buildBunbun test21import { describe, it, expect } from 'bun:test'
hone-themesJestnpm test452import { describe, it, expect } from '@jest/globals'
hone-extensionsVitestnpm testimport { describe, it, expect } from 'vitest'
hone-apitscnpm 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:testbun test
@jest/globals or no import (Jest globals)npm test (Jest)
vitestnpm 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

PackageCoverage Areas
hone-coreWorkspace management, settings, git integration, search, LSP client, DAP client, AI service, extension host
hone-editorPiece table buffer, multi-cursor editing, undo/redo, viewport calculations, tokenizer, search & replace, code folding, diff algorithm, LSP integration, DAP integration
hone-terminalVT100/VT220 escape sequence parser, terminal buffer, keyboard input handling, terminal emulator integration
hone-relayToken authentication, message buffering, WebSocket hub, configuration parsing
hone-buildArtifact storage, platform target normalization
hone-themesJSON schema validation for all 11 themes, WCAG contrast ratio compliance
hone-extensionsBuilt-in extension functionality
hone-apiType correctness of the public extension API (compile-time only)