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

docs(store): add guide for provideMockStore #1591

Merged
merged 7 commits into from
Mar 1, 2019

Conversation

lacolaco
Copy link
Contributor

@lacolaco lacolaco commented Mar 1, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

There is no guide for provideMockStore API.

What is the new behavior?

Added

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

maybe relates to #1383

@coveralls
Copy link

coveralls commented Mar 1, 2019

Coverage Status

Coverage remained the same at 89.512% when pulling 3224212 on lacolaco:mock-store-docs into 1ccbd49 on ngrx:master.

@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 1, 2019

Preview docs changes for 57dd876 at https://previews.ngrx.io/pr1591-57dd876/

projects/ngrx.io/content/guide/store/testing.md Outdated Show resolved Hide resolved
projects/ngrx.io/content/guide/store/testing.md Outdated Show resolved Hide resolved
projects/ngrx.io/content/guide/store/testing.md Outdated Show resolved Hide resolved

<code-example header="auth.guard.spec.ts">
import { TestBed } from '@angular/core/testing';
import { provideMockActions } from '@ngrx/effects/testing';
Copy link
Member

Choose a reason for hiding this comment

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

Remove unused imports

projects/ngrx.io/content/guide/store/testing.md Outdated Show resolved Hide resolved
projects/ngrx.io/content/guide/store/testing.md Outdated Show resolved Hide resolved
projects/ngrx.io/content/guide/store/testing.md Outdated Show resolved Hide resolved

describe('Auth Guard', () => {
let guard: AuthGuard;
let mockStore: MockStore<{ loggedIn: boolean } >;
Copy link
Member

Choose a reason for hiding this comment

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

The greater than/less than arrows need to be HTML entities to display correctly

@brandonroberts
Copy link
Member

@lacolaco I left some feedback. Will you move this to the top and change the title for Provide Store for testing to Using Store for Integration Testing.

Thanks!

brandonroberts and others added 5 commits March 1, 2019 23:04
Co-Authored-By: lacolaco <suguru.inatomi@gmail.com>
Co-Authored-By: lacolaco <suguru.inatomi@gmail.com>
Co-Authored-By: lacolaco <suguru.inatomi@gmail.com>
@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 1, 2019

Preview docs changes for 8df3fe7 at https://previews.ngrx.io/pr1591-8df3fe7/

### Providing Store for testing
### Using a Mock Store

The `provideMockStore()` method registers providers that allow you to mock out the `Store` for testing functionality that has a dependency on `Store` without setting up reducers.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is not a method but just function. isn't?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, function is better.

@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 1, 2019

Preview docs changes for ceb3ddd at https://previews.ngrx.io/pr1591-ceb3ddd/

1 similar comment
@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 1, 2019

Preview docs changes for ceb3ddd at https://previews.ngrx.io/pr1591-ceb3ddd/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 1, 2019

Preview docs changes for 240aa1d at https://previews.ngrx.io/pr1591-240aa1d/

1 similar comment
@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 1, 2019

Preview docs changes for 240aa1d at https://previews.ngrx.io/pr1591-240aa1d/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 1, 2019

Preview docs changes for 3224212 at https://previews.ngrx.io/pr1591-3224212/

@lacolaco
Copy link
Contributor Author

lacolaco commented Mar 1, 2019

@brandonroberts sorry for noisy commits! it's done!

@brandonroberts brandonroberts merged commit 5cb9a46 into ngrx:master Mar 1, 2019
@lacolaco lacolaco deleted the mock-store-docs branch March 1, 2019 15:07
@swapnil0545
Copy link

@brandonroberts
I have a naive question: I dont see this https://previews.ngrx.io/pr1591-3224212/guide/store/testing
on the real ngrx site. How do we come to know when the site gets updated?

@brandonroberts
Copy link
Member

@swapnil0545 It needs to be deployed, which I'll do today. You can also see what's latest on master if you go to https://next.ngrx.io

tja4472 pushed a commit to tja4472/platform that referenced this pull request Mar 20, 2019
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.

5 participants