{"id":15147318,"url":"https://github.com/factory-js/factory-js","last_synced_at":"2025-04-04T20:12:30.204Z","repository":{"id":227236358,"uuid":"770759571","full_name":"factory-js/factory-js","owner":"factory-js","description":"🏭 The object generator for testing.","archived":false,"fork":false,"pushed_at":"2025-03-31T15:09:06.000Z","size":774,"stargazers_count":67,"open_issues_count":12,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-31T16:36:25.138Z","etag":null,"topics":["drizzle-orm","dummy-data","e2e-testing","factory","factory-bot","fixture","integration-testing","jest","mock","playwright","prisma","seed","seeding","t3-stack","test","testing","unit-testing","vitest"],"latest_commit_sha":null,"homepage":"https://factory-js.github.io/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/factory-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-12T05:31:10.000Z","updated_at":"2025-03-24T09:13:07.000Z","dependencies_parsed_at":"2024-03-28T15:30:20.617Z","dependency_job_id":"285ee3ea-3334-4750-9578-389cdd3174e5","html_url":"https://github.com/factory-js/factory-js","commit_stats":{"total_commits":122,"total_committers":4,"mean_commits":30.5,"dds":0.4098360655737705,"last_synced_commit":"e4c2c1564d8ab51dafc1431ec9e6325385e0743f"},"previous_names":["factory-js/factory-js"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factory-js%2Ffactory-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factory-js%2Ffactory-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factory-js%2Ffactory-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/factory-js%2Ffactory-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/factory-js","download_url":"https://codeload.github.com/factory-js/factory-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242680,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drizzle-orm","dummy-data","e2e-testing","factory","factory-bot","fixture","integration-testing","jest","mock","playwright","prisma","seed","seeding","t3-stack","test","testing","unit-testing","vitest"],"created_at":"2024-09-26T12:40:39.369Z","updated_at":"2025-04-04T20:12:30.183Z","avatar_url":"https://github.com/factory-js.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"logo-invert.svg\"\u003e\u003csource media=\"(prefers-color-scheme: light)\" srcset=\"logo.svg\"\u003e\u003cimg width=\"38px\" src=\"logo.svg\" alt=\"\"\u003e\u003c/picture\u003e\u003ch3\u003eFactoryJS\u003c/h3\u003e\u003cp\u003eThe object generator for testing.\u003cp\u003e\u003cp\u003e\u003ca href=\"https://codecov.io/gh/factory-js/factory-js\"\u003e\u003cimg alt=\"coverage\" src=\"https://codecov.io/gh/factory-js/factory-js/graph/badge.svg?token=KJ4A3X0EJG\"\u003e\u003c/a\u003e \u003ca href=\"https://bundlephobia.com/package/@factory-js/factory\"\u003e\u003cimg alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/min/%40factory-js%2Ffactory\"\u003e\u003c/a\u003e\u003c/p\u003e\u003ca href=\"https://factory-js.github.io\"\u003eDocumentation\u003c/a\u003e・\u003ca href=\"./CONTRIBUTING.md\"\u003eContributing Guide\u003c/a\u003e\u003c/div\u003e\u003cbr\u003e\n\n## Features\n\n- ✅ **Type Safety** - It helps prevent configuration errors and typos.\n- ⚙️ **Highly Functional** - You can define variables, traits, and properties that depend on other properties.\n- 🪶 **Lightweight** - It is very lightweight as it does not depend on any other packages.\n- 📦 **ORM-Friendly API** - Designed to be used also with ORMs like Prisma and Drizzle.\n\n## Quick Start\n\n1. Install FactoryJS.\n\n```sh\npnpm add -D @factory-js/factory\n```\n\n2. Define a factory and use it in your tests, database seeds, etc.\n\n```ts\nimport { factory } from \"@factory-js/factory\";\n\n// Define the factory\nconst userFactory = factory.define({\n  props: {\n    firstName: () =\u003e \"John\",\n    lastName: () =\u003e \"Doe\",\n    role: () =\u003e \"guest\",\n  },\n  vars: {},\n});\n\ndescribe(\"when a user is admin\", () =\u003e {\n  it(\"returns true\", async () =\u003e {\n    const user = await userFactory(db)\n      .props({ role: () =\u003e \"admin\" }) // Override role to admin\n      .build();\n    expect(isAdmin(user)).toBe(true);\n  });\n});\n```\n\nTo learn more about FactoryJS, check the [Documentation](https://factory-js.github.io/).\n\n## License\n\n[MIT](https://github.com/factory-js/factory-js/blob/main/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffactory-js%2Ffactory-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffactory-js%2Ffactory-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffactory-js%2Ffactory-js/lists"}