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

test(component): update usage of TestBed.get to TestBed.inject #2311

Merged
merged 1 commit into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('User Greeting Component', () => {
});

fixture = TestBed.createComponent(UserGreetingComponent);
mockStore = TestBed.get(Store);
mockStore = TestBed.inject(Store);
mockUsernameSelector = mockStore.overrideSelector(fromAuth.getUsername, 'John');
fixture.detectChanges();
});
Expand Down
2 changes: 1 addition & 1 deletion projects/ngrx.io/content/guide/effects/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ TestBed.configureTestingModule({
],
});

effects = TestBed.get<CustomersEffects>(CustomersEffects);
effects = TestBed.inject<CustomersEffects>(CustomersEffects);

it('should not fetch if the user is already in the store', () => {
actions$ = hot('-a--', {
Expand Down
6 changes: 3 additions & 3 deletions projects/ngrx.io/content/guide/migration/v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ describe('My Effects', () => {
],
});

effects = TestBed.get(MyEffects);
runner = TestBed.get(EffectsRunner);
effects = TestBed.inject(MyEffects);
runner = TestBed.inject(EffectsRunner);
});

it('should work', () => {
Expand Down Expand Up @@ -318,7 +318,7 @@ describe('My Effects', () => {
],
});

effects = TestBed.get(MyEffects);
effects = TestBed.inject(MyEffects);
});

it('should work', () => {
Expand Down
4 changes: 2 additions & 2 deletions projects/ngrx.io/content/guide/store/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe('Auth Guard', () => {
],
});

store = TestBed.get<Store&gt(Store);
guard = TestBed.get<AuthGuard>(AuthGuard);
store = TestBed.inject<Store&gt(Store);
guard = TestBed.inject<AuthGuard>(AuthGuard);
});

it('should return false if the user state is not logged in', () => {
Expand Down