Faker, Seed Data & Fixtures
Generating fake users, products, orders, and other test fixtures.
Generic fakers
- ★
@faker-js/faker— the standard; ~60 locales; thousands of generators. Default. - chance — alternative; smaller; older.
- casual — older still; less maintained.
@anatine/zod-mock— generate mock data straight from Zod schemas. The pairing for any Zod-typed app.@ngneat/falso— alternative to faker; locales; tree-shakeable.
Schema-driven seed data
- ★ Drizzle Seed (
drizzle-seed) — generates realistic seed data from your Drizzle schema; the default if you're on Drizzle. - ★ Snaplet Seed — open source as of 2025; declarative seed graphs from Postgres schemas. Best in class.
- Prisma seeds —
prisma/seed.ts+ faker; conventional pattern. @vidalsasoon/objection-seed— for Objection.js.
Synthetic / production-shaped data
- ★ Snaplet Cloud — clones production into anonymized dev databases; the gold standard. Free tier.
- Tonic.ai — paid; enterprise; very accurate.
- Privacy Dynamics, Mostly AI — synthetic data with statistical fidelity.
pg_dump | sed— DIY; works for tiny apps.
Fixture / factory patterns
- ★ fishery — TypeScript-first factory builder.
- factory-bot-typescript — port of Ruby factory_bot.
@anatine/zod-mock— see above.- rosie — older test factory.
- Mock Service Worker (MSW) + faker — common combo for API-mocked tests.
Realistic-shape generators
fakerator,@faker-js/faker.helpers.fake— templates with placeholders.@stoplight/json-schema-sampler— sample data from JSON Schema.- JSF (JSON Schema Faker) — generate from JSON Schema (or Zod via
zod-to-json-schema). - OpenAPI examples —
Spectacle/prismwill generate sample bodies from your OpenAPI spec.
Specialized
@faker-js/faker.image.url+ picsum.photos — random placeholder images.- DiceBear — generate avatars from a seed.
- identicon-js — GitHub-style identicons.
- boring-avatars — beautiful generative avatars.
@ngneat/falsofinance / vehicle / commerce locales.
Generating realistic but consistent data
- ★ Seed your faker.
faker.seed(123)makes runs deterministic; reproducible test failures. - Reference IDs — when generating related rows, pass parent IDs explicitly.
- Skew toward edge cases — most fakers produce average-looking data; mix in long names, RTL strings, emoji, very large numbers.
- Localize —
faker.locale = 'ja'to pressure-test non-Latin layouts.
Cleaning up between tests
- Drizzle / Prisma transactions per test — wrap each test in a transaction that rolls back.
pg_truncate/ Drizzledelete— bulk wipe inbeforeEach.- Test container per worker — Vitest pool, each gets its own DB; slowest but most isolated.
- Snaplet snapshots — restore a known seed snapshot.
Pick this if…
- Default fake data:
@faker-js/faker. - Already on Zod:
@anatine/zod-mock. - Drizzle schema seeding: Drizzle Seed.
- Realistic prod-shape dev DB: Snaplet.
- Test factories: fishery.
- Generative avatars: boring-avatars or DiceBear.