Targ Apps Docs
Chroma-Fs

Testing

How to run the Chroma-Fs test suite and what it covers, for contributors.

Chroma-Fs uses Vitest with fake-indexeddb for unit and integration tests. Filesystem tests mock the Tauri adapter so CI and local runs do not require a Tauri host.

Commands

From the Chroma-Fs repository:

npm install
npm run build
npm test              # run once
npm run test:watch    # watch mode
npm run test:coverage # coverage report (v8)
npm run typecheck

What is covered

  • IndexedDB backend: text and binary read/write, mkdir, list, delete, recursive rmdir, path normalization, error cases.
  • Filesystem backend: the same contract through an injected TauriFsAdapter mock.
  • Configuration: inline config, configPath with fetch, and platform defaults (browser to IndexedDB, desktop to filesystem).

The same storage contract runs against both backends, so they behave identically. The postMessage bridge and the default Tauri wrapper are exercised in Desktop integration, not in unit tests.

On this page