{"id":15747164,"url":"https://github.com/rwaskiewicz/factory-mate-consumer","last_synced_at":"2025-03-31T06:26:27.967Z","repository":{"id":117137350,"uuid":"96705727","full_name":"rwaskiewicz/factory-mate-consumer","owner":"rwaskiewicz","description":"A sample application demonstrating the use of the factory-mate library","archived":false,"fork":false,"pushed_at":"2017-10-15T21:34:13.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T23:03:40.464Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwaskiewicz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2017-07-09T19:14:30.000Z","updated_at":"2017-07-09T19:27:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"d95cd8d1-2b3b-40d6-8643-fdf5c8a58579","html_url":"https://github.com/rwaskiewicz/factory-mate-consumer","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"6d24a4767f270ad72c4e545cf2a9e2f3a0c11129"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Ffactory-mate-consumer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Ffactory-mate-consumer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Ffactory-mate-consumer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaskiewicz%2Ffactory-mate-consumer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwaskiewicz","download_url":"https://codeload.github.com/rwaskiewicz/factory-mate-consumer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246425776,"owners_count":20775202,"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":[],"created_at":"2024-10-04T05:03:25.891Z","updated_at":"2025-03-31T06:26:27.936Z","avatar_url":"https://github.com/rwaskiewicz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FactoryMateConsumer\n\nThe purpose of this example project is to demonstrate the usage \n[FactoryMate](https://github.com/rwaskiewicz/factory-mate) library.\n\n## About\nThis sample project has an entry point at `src/App.ts`, which calls a service, `CartBuilderService`, to instantiate a \nnumber of domain objects of the type `GroceryItem`.  `CartBuilderService` relies on another service, \n`GroceryBuilderService`, in order to instantiate the `GroceryItem` entities and populating the \n`GroceryItem#groceryName` field. Once the `CartBuilderService` has built a certain number of entities, they are printed\nout to the console. \n\n```\n├── src\n│   ├── App.ts\n│   ├── domain\n│   │   ├── GroceryItem.ts\n│   │   └── GroceryItemFactory.ts\n│   └── services\n│       ├── CartBuilderService.spec.ts\n│       ├── CartBuilderService.ts\n│       └── GroceryBuilderService.ts\n```\n\n## Notable Files\n\n### ```GroceryItemFactory.ts```\n`GroceryItemFactory.ts` acts as a small factory class for defining how FactoryMate will define `GroceryItem` instances.  \n\nThe class is annotated with the `@FactoryMateAware` decorator, which allows the class to be marked by FactoryMate \nat runtime. This allows the `define()` method to be called automatically and register the template for the `GroceryItem` instance\n\n### ```CartBuilderService.spec.ts```\n\n`CartBuilderService.spec.ts` acts as a single Jasmine-based test file that is used to demonstrate the usage of \n`FactoryMate` within a test suite.  Instead of instantiating the `GroceryItem` object directly within the test suite \n(and theoretically across several other suites), an instance is simply instantiated via:\n\n```const groceryItem: GroceryItem = FactoryMate.build(GroceryItem.name);```\n\nThis spec file also demonstrates how to override the default template as well as how to build an array containing more\nthan one of the desired object.\n\n## Running the Demo Application\n\nRun the following at the root of the project:\n\n1. Install the required dependencies: `npm install`\n2. Compile the project: `npm run compile`\n3. Run the project: `npm start`\n\n## Running the Demo Tests\n\nRun the following at the root of the project:\n\n1. Install the required dependencies: `npm install`\n2. Start the Tests: `npm test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwaskiewicz%2Ffactory-mate-consumer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwaskiewicz%2Ffactory-mate-consumer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwaskiewicz%2Ffactory-mate-consumer/lists"}