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 typecheckWhat 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
TauriFsAdaptermock. - Configuration: inline config,
configPathwithfetch, 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.
Related
- Configuration —
chroma-fs.jsonper template
Chroma-Fs as a plugin
Enable Chroma-Fs in an app through chroma.json and get a ready storage instance from the plugin loader.
Chroma-Style
@chroma/style — design tokens, tw() class merging, prose typography and cva presets for Chroma apps; its utility CSS generator is the native chroma-style build plugin of the Chroma CLI.