Skip to content

Commit

Permalink
docs: update usage of TestBed.get to TestBed.inject (#2311)
Browse files Browse the repository at this point in the history
Closes #2240
  • Loading branch information
sumitparakh authored and brandonroberts committed Jan 12, 2020
1 parent fe2b190 commit 2cc8885
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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

0 comments on commit 2cc8885

Please sign in to comment.