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

Add more Fx.Decorate tests #846

Merged
merged 3 commits into from Feb 22, 2022
Merged

Add more Fx.Decorate tests #846

merged 3 commits into from Feb 22, 2022

Conversation

sywhang
Copy link
Contributor

@sywhang sywhang commented Feb 22, 2022

This adds more cases of fx.Decorate tests, specifically for
transitive dependencies that are decorated. For example, when a
function depends on type A whose constructor depends on type B,
and B has a decorator associated with it, we expect type A's constructor
to use the decorated value of B in its constructor.

This adds more cases of fx.Decorate tests, specifically for
transitive dependencies that are decorated. For example, when a
function depends on type A whose constructor depends on type B,
and B has a decorator associated with it, we expect type A's constructor
to use the decorated value of B in its constructor.
@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #846 (0b48082) into master (7bb5b40) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #846   +/-   ##
=======================================
  Coverage   98.63%   98.63%           
=======================================
  Files          30       30           
  Lines        1100     1100           
=======================================
  Hits         1085     1085           
  Misses         10       10           
  Partials        5        5           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7bb5b40...0b48082. Read the comment docs.

Comment on lines +253 to +259
fx.Module("child",
fx.Decorate(func() *Config {
return &Config{Scope: "child"}
}),
fx.Invoke(func(l *Logger) {
assert.Equal(t, "child logger", l.Cfg.Scope)
}),
Copy link
Collaborator

Choose a reason for hiding this comment

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

😮

I didn't think of this one. This is nice.

Copy link

@dhackner dhackner left a comment

Choose a reason for hiding this comment

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

:-)

@sywhang sywhang merged commit e279a3d into uber-go:master Feb 22, 2022
@sywhang sywhang deleted the more-tests branch February 22, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants