-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
next (temp) [WIP] #99
Closed
Conversation
This file contains 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
…anism - Entirely restructure the package to align with the updated adapters design, emphasizing container-based operations over map-based approaches. BREAKING CHANGE: - Eliminate multiple interfaces and types to streamline the package: - `ClassDependencies` - `ClassCtorInjectables` - `ClassInjectableProperty` - `ClassPropsInjectables` - `ClassDependenciesMap` - `DependenciesReflector` - Transition from `PrimitiveValue` to the more descriptive `ConstantValue`.
- Implement a revamped mechanism for the NestJS adapter, aligning with the new `AutomockDependenciesAdapter` interface. BREAKING CHANGE: - Replace `DependenciesReflector` with the more versatile `AutomockDependenciesAdapter`. - Modify export strategy: Shift from native literal export to default module export.
- Revamp the `UnitReference` interface to: - Incorporate symbols as identifiers. - Offer more precise generic parameters. - Reorganize core types for better modularity: - Relocate `Type` to `@automock/types`. - Shift `UnitTestBed` to `@automock/core`. - Adjust package dependencies: - Exclude `@automock/adapters.nestjs` from the npm dependencies in `package.json`. - Introduce `@types/sinon` as a peer dependency. BREAKING CHANGE: - Users will need to adjust their imports due to the migration of `Type` and `UnitTestBed`. - Adherence to the updated `UnitReference` interface might be necessary. - Dependency changes may require updates in user projects.
- Revise the `UnitReference` interface to: - Support symbols as identifiers. - Provide more accurate generic parameters. - Relocate core types for better organization: - Move `Type` to `@automock/types`. - Transfer `UnitTestBed` to `@automock/core`. - Cleanup package dependencies: - Remove `@automock/adapters.nestjs` from the npm dependencies in `package.json`. - Simplify and declutter: - Introduce a new, streamlined `UnitReference` interface. - Eliminate the `@Reflectable` decorator. - Remove redundant types: `MockFunction`, `Override`, and `TestBedResolver`. BREAKING CHANGE: - Users will need to update their imports due to the relocation of `Type` and `UnitTestBed`. - Adjustments may be required for the new `UnitReference` interface. - Removal of certain decorators and types might affect existing implementations.
BREAKING CHANGE: - Remove `TClass` generic arg from `StubbedInstance` - Refactor `DeepPartial`, remove arrays from it
- Adopt a dependencies container approach over the previous dependencies map. - Introduce custom Automock errors for better error clarity. - Refine the `UnitReference` interface for improved type safety. - Utilize `require` with default in the package resolver. - Add integration tests to validate new changes. - Enhance JSDoc comments for better clarity. - Update terminology: Replace "primitive" with "constant value". - Remove redundant warning about undefined dependency values. - Adjust error messages for more accurate feedback on invalid dependencies. - Introduce error handling for invalid dependency identifiers in `.mock()`. BREAKING CHANGE: - Transition from native `Error` to `InvalidIdentifierError` in `UnitReference`. - Update `UnitReference.get()` to return both ConstantValue and StubbedInstance.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #99 +/- ##
==========================================
+ Coverage 88.02% 89.00% +0.97%
==========================================
Files 13 10 -3
Lines 192 200 +8
Branches 29 32 +3
==========================================
+ Hits 169 178 +9
+ Misses 19 15 -4
- Partials 4 7 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Major Refactor and Enhancement of Automock Core and Adapters
This PR introduces significant changes to the Automock library, aiming to enhance its adaptability, maintainability, and user experience. The changes are a culmination of feedback, continuous integration testing, and the need to support a broader spectrum of use-cases.
Key Changes:
Refactoring of Core Mechanisms:
UnitReference
, to support symbols and provide more accurate generic parameters.AutomockDependenciesAdapter
interface, paving the way for more extensible and customizable adapter mechanisms.Enhancements to Adapters:
AutomockDependenciesAdapter
interface.@types/sinon
as a peer dependency.Improvements in Common Utilities:
ConstantValue
as a replacement forPrimitiveValue
, providing a clearer distinction for values that remain unchanged during tests.Documentation and Typing:
Breaking Changes: