-
Notifications
You must be signed in to change notification settings - Fork 21
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 inRequestScope decorator inversify/InversifyJS/issues/678 #151
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
public done(force?: boolean) { | ||
return this._provideDoneSyntax.done(force); | ||
} | ||
|
||
private provideWhenOnSyntax(bindingWhenOnSyntax: interfaces.BindConstraint) { |
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.
Pulled this out to reduce duplicate code
expect(inTransientScopeExpectation.calledOnce).to.eql(true, "inTransientScope was not called exactly once"); | ||
expect(mockBind.calledWith("Ninja")).to.be.eql(true, "mock bind was not called"); | ||
|
||
["inSingletonScope", "inRequestScope", "inTransientScope"].forEach(scope => { |
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 combined the shared aspects of the code into one repeated test (the equivalent of a data provider).
The weirdest part was calling provideInSyntax.in[...]Scope()
. I haven't called a string as a function in typescript so I ended up defining it as an object with string keys to get around the no-implicit-any
compiler issue. I'm open to other approaches.
@remojansen Just wanted to ping to see if there was anything else needed for this PR |
@dcavanagh Hey Dan! Would something like this go through you now? |
@remojansen @dcavanagh I'm also interested in this PR! Is there something that I can help? |
@jakehamtexas do you see any problems here, seems good to me at a first look. |
hi guys, can we merge this change in? |
Hmm inversify seems to be a dead project :( |
Description
This adds
inRequestScope
support influentProvide
.Related Issue
inversify/InversifyJS/issues/678
How Has This Been Tested?
inSingletonScope
andinTransientScope
to also includeinRequestScope
.provide_in_syntax.test.ts
refactored to reduce duplicate code.Types of changes
Checklist: