Merged
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR focuses on making the library more robust and publishable by adding a comprehensive Jest test suite (unit + integration + Nest controller/module coverage), centralizing test helpers, and updating documentation to reflect the intended package architecture (notably: repository implementations living in separate DB packages).
Changes:
- Added extensive Jest tests across core, infra providers, and NestJS integration; introduced shared mocks/factories in
test/test-utils.ts. - Tightened Jest configuration (coverage reporting + thresholds) and updated TS config/types to support the new tests.
- Removed in-repo concrete repository implementations and updated infra exports/docs toward “schema reference only” + external DB packages; expanded top-level docs (README/CONTRIBUTING/CHANGELOG/changeset).
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Adds node types to support Node globals in tests/build. |
| test/test-utils.ts | Introduces shared mocks/factories for tests to reduce duplication. |
| test/smoke.spec.ts | Expands smoke test to validate module exports/structure. |
| test/integration.test.ts | Adds Nest testing-module integration tests for end-to-end flows. |
| src/nest/module.test.ts | Adds unit tests for Nest module registration and DI wiring. |
| src/nest/decorators.test.ts | Adds tests for DI decorators and injection tokens. |
| src/nest/controllers/webhook.controller.test.ts | Adds unit tests for webhook controller behaviors. |
| src/nest/controllers/notification.controller.test.ts | Adds unit tests for REST controller behaviors/mappings. |
| src/infra/repositories/mongoose/notification.schema.ts | Adjusts optional-mongoose runtime schema typing behavior. |
| src/infra/repositories/mongoose/mongoose.repository.ts | Removes in-repo Mongoose repository implementation. |
| src/infra/repositories/index.ts | Limits infra repository exports to schema references and clarifies intent. |
| src/infra/repositories/in-memory/in-memory.repository.ts | Removes in-repo in-memory repository implementation. |
| src/infra/providers/providers.test.ts | Adds tests for infra providers (id/date/template/event emitters). |
| src/infra/index.ts | Updates infra layer docs to reflect schema-only repos + external DB packages. |
| src/infra/README.md | Updates infra documentation for external DB repos + schema reference guidance. |
| src/core/notification.service.test.ts | Adds broad unit test coverage for core NotificationService behaviors. |
| src/core/errors.test.ts | Adds unit tests for error classes and inheritance. |
| src/core/dtos.test.ts | Adds unit tests for DTO validation schemas and helpers. |
| package.json | Adds Nest testing deps to devDependencies. |
| package-lock.json | Updates lockfile for new devDependencies and transitive deps. |
| jest.config.ts | Expands test discovery patterns, adds coverage reporters/thresholds, tightens mock resets. |
| README.md | Replaces placeholder README with comprehensive package documentation and examples. |
| CONTRIBUTING.md | Replaces placeholders and adds testing/quality guidance. |
| CHANGELOG.md | Adds a changelog documenting testing/docs/quality work. |
| .github/instructions/testing.instructions.md | Adds guidance and examples for shared test utilities. |
| .changeset/notificationkit_71368.md | Updates changeset to describe the comprehensive testing + docs changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Why
Checklist
npm run lintpassesnpm run typecheckpassesnpm testpassesnpm run buildpassesnpx changeset) if this affects consumersNotes