-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(schematics): Use prefix option in feature schematic #3139
Conversation
This allows sharing the prefix logic with rest of the schematics.
This allows generation of effects with a prefix.
This allows generating reducers with a prefix
Previously, passing --prefix when generating a feature would make changes only in the generated action. This passes the prefix option to the effect and reducers as well. Fixes ngrx#3116
1ddec0f
to
f1e03c7
Compare
Hi @hemangsk thanks for opening a PR. |
Hi @timdeschryver, yes this is ready for review now, can you please take a look? |
Thanks @hemangsk , we'll take a look as soon as we can. |
@@ -463,4 +464,35 @@ describe('Effect Schematic', () => { | |||
|
|||
expect(content).toMatch(/effects = TestBed\.inject\(FooEffects\);/); | |||
}); | |||
|
|||
it('should add prefix to the effect', async () => { |
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.
One small remark, could you also write a test for when the action creators
option is true
please, because that's the one that is most used. The rest is looking good 👍
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.
@timdeschryver , added a test with creators option set as true
for in the effect spec file. I'm not sure but do we need tests with creators: true
in feature
and reducer
as well?
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.
The feature
and reducer
tests are by default creators: true
, so this is fine for me.
Thanks for updating the PR! 👍
7b42544
to
3ec9173
Compare
Thanks @hemangsk ! |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #3116
What is the new behavior?
When using the
feature
schematic with--prefix
option,effects
andreducers
will use the supplied prefix.action
already uses the supplied prefix.Does this PR introduce a breaking change?
Other information