Generates Vitest + @testing-library/svelte smoke tests — one
*.test.ts file colocated next to every generated Svelte
component. The tests assert the component mounts with minimally
valid props and exposes key entity fields in the DOM. They are
deliberately thin — a CI oracle that catches "my prop contract
changed and the component now throws", not a full UX regression
suite.
Consumer apps need vitest and @testing-library/svelte as
dev-dependencies. Caravela's generated package.json entries
(shipped as documentation in v0.12+) pin compatible versions.
Returns a list of {path, source} tuples.
Summary
Functions
Generate a Vitest file per Svelte component kind per entity.
Generate a single test file.
Colocated test-file path next to the generated Svelte file.
Functions
@spec render_all( Caravela.Schema.Domain.t(), keyword() ) :: [{String.t(), String.t()}]
Generate a Vitest file per Svelte component kind per entity.
@spec render_component( Caravela.Schema.Domain.t(), Caravela.Schema.Entity.t(), :index | :show | :form, keyword() ) :: {String.t(), String.t()}
Generate a single test file.
@spec test_file_path( Caravela.Schema.Domain.t(), Caravela.Schema.Entity.t(), :index | :show | :form ) :: String.t()
Colocated test-file path next to the generated Svelte file.