<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wasef Hussain</title>
    <description>The latest articles on DEV Community by Wasef Hussain (@wasef_hussain_2145ce814de).</description>
    <link>https://dev.to/wasef_hussain_2145ce814de</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3968820%2F37852ea7-00aa-4ca2-9963-65d2b3f53882.jpg</url>
      <title>DEV Community: Wasef Hussain</title>
      <link>https://dev.to/wasef_hussain_2145ce814de</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wasef_hussain_2145ce814de"/>
    <language>en</language>
    <item>
      <title>I built a tool that generates TypeScript fixtures from interfaces and Zod schemas</title>
      <dc:creator>Wasef Hussain</dc:creator>
      <pubDate>Thu, 04 Jun 2026 20:15:54 +0000</pubDate>
      <link>https://dev.to/wasef_hussain_2145ce814de/i-built-a-tool-that-generates-typescript-fixtures-from-interfaces-and-zod-schemas-g52</link>
      <guid>https://dev.to/wasef_hussain_2145ce814de/i-built-a-tool-that-generates-typescript-fixtures-from-interfaces-and-zod-schemas-g52</guid>
      <description>&lt;p&gt;Every TypeScript project reaches the same point: you've defined your types, now you need mock data for tests, Storybook stories, or local dev. You end up hand-writing the same boilerplate &lt;code&gt;mockUser&lt;/code&gt;, &lt;code&gt;mockProduct&lt;/code&gt;, &lt;code&gt;mockOrder&lt;/code&gt; objects over and over.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;FixtureKit&lt;/strong&gt; to fix that — a free developer tool, not a product pitch.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Paste a TypeScript &lt;code&gt;interface&lt;/code&gt;, &lt;code&gt;type&lt;/code&gt;, or a Zod &lt;code&gt;z.object(...)&lt;/code&gt; schema → get a copy-ready &lt;code&gt;export const mock…&lt;/code&gt; TypeScript fixture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://fixture-kit.vercel.app" rel="noopener noreferrer"&gt;https://fixture-kit.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Product&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;inStock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mockProduct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;f47ac10b-58cc-4372-a567-0e02b2c3d479&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Wireless Keyboard&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;49.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;inStock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;electronics&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;accessories&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What makes it useful&lt;/strong&gt;&lt;br&gt;
Semantic field inference — it doesn't just fill every string with "value". Field names like email, name, url, price, createdAt map to realistic value pools. Type compatibility is enforced: you won't get an email string on a number field.&lt;/p&gt;

&lt;p&gt;Deterministic output — uses a hash of the field name + fixture index. No Math.random(). Same schema always gives the same output. Safe to commit.&lt;/p&gt;

&lt;p&gt;No eval, no backend — Zod schemas parsed with a custom recursive-descent parser. TypeScript schemas use the TypeScript compiler API. Everything runs in the browser.&lt;/p&gt;

&lt;p&gt;Generate up to 5 fixtures at once — useful for seeding UI components or table/list test cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Supported input&lt;/strong&gt;&lt;br&gt;
TypeScript: interface, type, arrays, nested objects, optional fields, unions, literal types&lt;/p&gt;

&lt;p&gt;Zod: z.object, z.string, z.number, z.boolean, z.array, z.enum, z.union, z.literal, .optional(), .nullable(), nested z.object&lt;/p&gt;

&lt;p&gt;Advanced features (generics, utility types, .refine, .transform) are out of scope and return a clear error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech&lt;/strong&gt;&lt;br&gt;
React 18 · TypeScript 5 · Vite · TypeScript compiler API (in-browser)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/Wasef-Hussain/FixtureKit" rel="noopener noreferrer"&gt;https://github.com/Wasef-Hussain/FixtureKit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback welcome — especially on schema shapes I haven't handled well.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>testing</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
