Skip to content

Fix/issues#1

Merged
khatabwedaa merged 2 commits into
mainfrom
fix/issues
Apr 15, 2026
Merged

Fix/issues#1
khatabwedaa merged 2 commits into
mainfrom
fix/issues

Conversation

@khatabwedaa
Copy link
Copy Markdown
Contributor

No description provided.

Improves test suite robustness by covering previously untested scenarios including non-existent state handling, factory lifecycle hooks (afterMake/afterCreate), missing DataSource error cases, and event emitter integration.

Adds tests for seeders without order property and configurations with no seeders to ensure graceful handling of edge cases.

Introduces UserFactoryWithHooks test helper to verify lifecycle hook functionality.
Copilot AI review requested due to automatic review settings April 15, 2026 11:44
@khatabwedaa khatabwedaa merged commit 6e9adac into main Apr 15, 2026
3 checks passed
@khatabwedaa khatabwedaa deleted the fix/issues branch April 15, 2026 11:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the test suite and documentation to cover additional edge cases and integrations for @nestbolt/factory, including seeding behavior, factory hooks, and optional event emission.

Changes:

  • Add tests for seed() behavior with no seeders configured and seeders missing an order property.
  • Add test coverage for factory builder behaviors (unknown named state, afterMake/afterCreate hooks, and create() without a DataSource).
  • Update package/README description text and remove the README “Credits” section.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/seeder.spec.ts Adds coverage for seed() edge cases (no seeders; default ordering).
test/helpers/test-entities.ts Adds a test factory variant with afterMake/afterCreate hooks.
test/factory.service.spec.ts Adds tests for FactoryNotInitializedException and EventEmitter integration.
test/factory-builder.spec.ts Adds tests for unknown states, factory hooks, and missing DataSource error behavior.
package.json Updates package description text.
README.md Updates header description text and removes “Credits” section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 5 to +9
import { DataSource } from "typeorm";
import { FactoryService } from "../src/factory.service";
import { FactoryBuilder } from "../src/factory-builder";
import { FactoryNotRegisteredException } from "../src/exceptions/factory-not-registered.exception";
import { FactoryNotInitializedException } from "../src/exceptions/factory-not-initialized.exception";
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataSource is imported but never used in this spec file. With typescript-eslint recommended rules enabled, this will fail lint (no-unused-vars). Remove the unused import (or start using it in a test) to keep CI green.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants