-
-
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
feat(schematics): add component store schematics #2886
feat(schematics): add component store schematics #2886
Conversation
Preview docs changes for 7fc3766 at https://previews.ngrx.io/pr2886-7fc3766a/ |
a81b3db
to
1d1caae
Compare
You need to run |
@brandonroberts It cause newly added methods disappearing from the ast-utils.ts. Is that expected? |
Yes. You need to add the changes to modules/schematics-core first, then run the command to sync the changes in all the libraries. We do it this way because it's not currently a standalone package |
3442390
to
4044362
Compare
@brandonroberts seems to be fine now despite of Labeler which probably fail for the forks. |
One request would be to change the test scaffolding to not use the TestBed, and just create a new instance of the ComponentStore cc: @alex-okrushko |
4044362
to
67e4d4e
Compare
@brandonroberts done. |
67e4d4e
to
7fc3766
Compare
While waiting for the PR to be reviewed, is there a sample of a spec file generated with this schematic somewhere ? I'm looking for something to help me with unit testing in component store. |
The spec is pretty minimal. The <% references are just placeholders import { <%= classify(name) %>Store } from './<%= dasherize(name) %>.store';
describe('<%= classify(name) %>Store', () => {
const componentStore = new <%= classify(name) %>Store();
it('should be created', () => {
expect(componentStore).toBeTruthy();
});
}); |
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 #2570
What is the new behavior?
Does this PR introduce a breaking change?
Other information