-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: sociable unit test functionality #275
base: master-suites
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master-suites #275 +/- ##
=================================================
- Coverage 93.41% 92.49% -0.92%
=================================================
Files 19 23 +4
Lines 410 493 +83
Branches 81 91 +10
=================================================
+ Hits 383 456 +73
- Misses 16 27 +11
+ Partials 11 10 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
aa798a0
to
ee94156
Compare
@soryy708 up for review? |
); | ||
} | ||
|
||
public static sociable<TClass = any>(targetClass: Type<TClass>): SociableTestBedBuilder<TClass> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find any tests covering this new user-facing API?
I see tests that cover the insides, but nothing drives it as a user would?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is e2e
that I need to apply as well, you are right
); | ||
|
||
const testBed = await unitBuilder | ||
.expose(UserApiService) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is a public user-facing API, lets discuss the chosen terminology expose
, to mark a dependency to not be faked.
What is the mental model Automock tries to give its users about what dependencies get replaced with test-doubles and what aren't?
In my mind for example, since Automock uses the terminology: automock
, mock
... using
, I'd expect this to be called dontMock
or something like that.
Relates to: #230 |
) { | ||
this.logger.log('Just logging a message'); | ||
|
||
if (typeof this.logger.log !== 'function') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this.logger.log
isn't a function then we'll never reach this check, because of the previous this.logger.log
invocation (that will throw)
@@ -206,7 +204,7 @@ export interface MockOverride<TDependency, TClass> { | |||
/** | |||
* Specifies a constant value to be used for the mocked dependency. | |||
* | |||
* @since 2.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this changed?
No description provided.