Files
ui/pkg/data/vitest.config.ts
zeekay c3f0ed7f97 feat(data): every field displays on the record kit
A select is a Tag in its option's hue, several values one OverflowingList
with a +N, an email, link or phone a round pill with its mailto/https/tel
target (a javascript: URL is drawn, never linked), a relation or an actor a
record chip with its avatar, a rating the star row, a boolean a check and
its word. Rich text shows its first line; a full name, an address (the
country by name) and a uuid have their own; colours are theme rungs, so the
cells follow the theme.

A date shows its day in UTC: parsed as local midnight, 2026-10-19 read as
the 18th west of Greenwich.

The package registers @hanzo/ui's gui config instead of its own, and its
component suites mount in jsdom under that config.
2026-10-19 08:45:26 -07:00

31 lines
1.3 KiB
TypeScript

import { defineConfig } from 'vitest/config'
// @hanzo/ui's resolutions for a non-browser target, read from the one place it
// keeps them, so this suite and @hanzo/ui's own resolve gui identically.
import { alias } from '../ui/scripts/alias.mjs'
/**
* Two kinds of suite, one runner, as in @hanzo/ui.
*
* `*.test.ts` — the PURE logic (sort / filter / group / view state, value
* coercion): plain Node, no gui runtime.
* `*.test.tsx` — the field displays, editors and the table MOUNT under the real
* GuiProvider and @hanzo/ui's config, in jsdom (`@vitest-environment
* jsdom` at the top of the file). @hanzo/ui is read from its built
* `dist`, as a consumer reads it, so build it first
* (`pnpm --filter @hanzo/data... build` does).
*/
export default defineConfig({
css: { postcss: { plugins: [] } },
resolve: { alias },
test: {
environment: 'node',
testTimeout: 60_000,
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
setupFiles: ['../ui/vitest.setup.ts'],
// gui and react-native-web re-export one module graph; inlined, they resolve
// to one instance, so the provider and the components read the same theme.
server: { deps: { inline: [/@hanzogui\//, /@hanzo\/gui/, /react-native/, /@hanzo\/ui/] } },
},
})