Skip to content
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

Open
wants to merge 7 commits into
base: master-suites
Choose a base branch
from

Conversation

omermorad
Copy link
Member

No description provided.

@omermorad omermorad marked this pull request as draft January 21, 2024 21:13
Copy link

codecov bot commented Jan 21, 2024

Codecov Report

Attention: Patch coverage is 90.79755% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 92.61%. Comparing base (044515b) to head (552c3be).

Files Patch % Lines
packages/core/src/services/dependency-resolver.ts 83.67% 7 Missing and 1 partial ⚠️
...ore/src/services/builders/sociable-unit-builder.ts 86.66% 4 Missing ⚠️
packages/core/src/services/functions.static.ts 76.92% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           master-suites     #275      +/-   ##
=================================================
- Coverage          93.41%   92.61%   -0.80%     
=================================================
  Files                 19       24       +5     
  Lines                410      501      +91     
  Branches              81       91      +10     
=================================================
+ Hits                 383      464      +81     
- Misses                16       27      +11     
+ Partials              11       10       -1     
Flag Coverage Δ
core.unit 92.10% <90.79%> (-2.85%) ⬇️
di.inversify 93.68% <ø> (ø)
di.nestjs 87.25% <ø> (ø)
doubles.jest 100.00% <ø> (ø)
doubles.sinon 100.00% <ø> (ø)
doubles.vitest 100.00% <ø> (ø)
unit 83.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from next to master-suites March 21, 2024 17:17
@omermorad omermorad changed the title feat(common,core): sociable unit test functionality feat: sociable unit test functionality Apr 2, 2024
@omermorad omermorad marked this pull request as ready for review April 2, 2024 17:05
@omermorad
Copy link
Member Author

omermorad commented Apr 2, 2024

@soryy708 up for review?

}

public static create<TClass = any>(targetClass: Type<TClass>): TestBedBuilder<TClass> {
public static create<TClass = any>(targetClass: Type<TClass>): SolitaryTestBedBuilder<TClass> {
Copy link

Choose a reason for hiding this comment

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

Backwards-compatible API. Awesome!

Copy link
Member Author

Choose a reason for hiding this comment

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

lol. Yes it'a gonna be a whole new framework under the scope @suites.

);
}

public static sociable<TClass = any>(targetClass: Type<TClass>): SociableTestBedBuilder<TClass> {
Copy link

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?

Copy link
Member Author

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)
Copy link

@soryy708 soryy708 Apr 2, 2024

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.

@soryy708
Copy link

soryy708 commented Apr 2, 2024

Relates to: #230

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.

None yet

2 participants