Decorated Factory

A powerful tool for creating test data with TypeScript decorators

Built for Developer Experience

Decorated Factory was crafted by developers, for developers. The focus is on a great DX/UX: a clean, declarative TypeScript API with intuitive decorators that make generating realistic test data fast, predictable, and type-safe—without extra boilerplate or hidden magic.

Declarative API

Use TypeScript decorators to define how to generate data for each field of a class, making your code clean and readable.

Relationship Support

Easily create complex data structures with support for entity relationships, arrays, and key bindings.

Testing Made Easy

Generate realistic test data with minimal effort, making your tests more robust and easier to maintain.

Simple & Powerful

Decorated Factory makes it easy to generate test data with just a few lines of code. Define your models once, and create instances with realistic data whenever you need them.

See more examples

class Product {
  @FactoryField((faker) => faker.number.int())
  id: number;

  @FactoryField((faker) => faker.commerce.productName())
  name: string;
}

const factory = new Factory(faker);
const product = factory.one(Product).make();

// product = { id: 42, name: "Ergonomic Wooden Chair" }
						

Ready to Get Started?

Explore the documentation to learn more about Decorated Factory and how it can help you generate test data for your projects.

Read the Docs