lolmaus (Andrey Mikhaylov)
lolmaus (Andrey Mikhaylov)
Explore posts from servers
DTDrizzle Team
Created by lolmaus (Andrey Mikhaylov) on 10/27/2023 in #help
Acceptance testing practices? In-memory Postgres mock for high-speed acceptance testing?
Hi! I'm using Drizzle with SvelteKit and Vercel Postgres. I would like to do extensive acceptance test coverage. I want my tests to be: * very fast: Postgres speed is a drag when you have thousands of test cases; * very reliable: not prone to network hiccups, paywalls, etc; * isolated: the database should be recreated from scratch for every test case, so that state does not leak from test to test and from job to job. These requirements make using real Postres database in tests not feasible. I would like the test env (and the dev env too, for that matter!) use a fast in-memory equivalent of Postgres. What are my options? I can't believe that I'm the first one to have such requirements. PS I considered using a non-SQL database mock solution such as https://miragejs.com . This is feasible, but I lose Drizzle's type safety and fluency. I want to stay in Drizzle land.
13 replies