@happyvertical/smrt-vitest 0.39.1 → 0.39.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/setup.js +40 -12
- package/dist/setup.js.map +1 -1
- package/dist/sqlite-schema-template.d.ts +30 -0
- package/dist/sqlite-schema-template.d.ts.map +1 -0
- package/dist/sqlite-schema-template.js +136 -0
- package/dist/sqlite-schema-template.js.map +1 -0
- package/dist/test-db.d.ts +4 -0
- package/dist/test-db.d.ts.map +1 -1
- package/dist/test-db.js +27 -12
- package/dist/test-db.js.map +1 -1
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -48,6 +48,13 @@ same `retry` policy inline in their own `vitest.config.ts`.
|
|
|
48
48
|
|
|
49
49
|
**DB adapter auto-detection**: `DATABASE_URL` set → PostgreSQL; otherwise → SQLite temp files.
|
|
50
50
|
|
|
51
|
+
For local file-backed SQLite, identical schemas are prepared once per Vitest
|
|
52
|
+
process and cloned from an immutable schema-only template for later databases.
|
|
53
|
+
The cache key is the full generated DDL, concurrent first callers share one
|
|
54
|
+
build, and every test still receives its own database file and transaction.
|
|
55
|
+
Existing non-empty database files are never replaced. PostgreSQL, DuckDB, JSON,
|
|
56
|
+
remote libSQL, and in-memory SQLite retain their normal preparation paths.
|
|
57
|
+
|
|
51
58
|
```typescript
|
|
52
59
|
let db, cleanup;
|
|
53
60
|
beforeEach(async () => {
|
|
@@ -103,6 +110,7 @@ Pattern: render → assert role/name/state → drive with user-event → prove a
|
|
|
103
110
|
|
|
104
111
|
- `src/index.ts` — Vite plugin, manifest generation, workspace aliases, all exports
|
|
105
112
|
- `src/setup.ts` — globalThis isolation setup file
|
|
113
|
+
- `src/sqlite-schema-template.ts` — process-local immutable SQLite schema templates
|
|
106
114
|
- `src/svelte-setup.ts` — Svelte component-test setup (jest-dom, cleanup, dialog polyfill)
|
|
107
115
|
- `src/svelte.ts` — component-test surface (Testing Library + a11y, one import)
|
|
108
116
|
- `src/a11y.ts` — `expectNoA11yViolations` (axe-core)
|