Skip to content

Commit 11d3b9f

Browse files
dummdidummbrandonroberts
authored andcommitted
fix(router-store): Avoiding @ngrx/effects dependency inside tests
1 parent fe71ffb commit 11d3b9f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/router-store/spec/integration.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, Provider } from '@angular/core';
22
import { TestBed } from '@angular/core/testing';
33
import { NavigationEnd, Router, RouterStateSnapshot } from '@angular/router';
44
import { RouterTestingModule } from '@angular/router/testing';
5-
import { Store, StoreModule } from '@ngrx/store';
5+
import { Store, StoreModule, ScannedActionsSubject } from '@ngrx/store';
66
import { filter, first, mapTo, take } from 'rxjs/operators';
77

88
import {
@@ -19,7 +19,6 @@ import {
1919
ROUTER_REQUEST,
2020
ROUTER_NAVIGATED,
2121
} from '../src/router_store_module';
22-
import { EffectsModule, Actions } from '@ngrx/effects';
2322

2423
describe('integration spec', () => {
2524
it('should work', (done: any) => {
@@ -709,7 +708,6 @@ function createTestModule(
709708
declarations: [AppCmp, SimpleCmp],
710709
imports: [
711710
StoreModule.forRoot(opts.reducers),
712-
EffectsModule.forRoot([]),
713711
RouterTestingModule.withRoutes([
714712
{ path: '', component: SimpleCmp },
715713
{
@@ -760,7 +758,8 @@ function waitForNavigation(router: Router) {
760758
function logOfRouterAndActionsAndStore(): any[] {
761759
const router: Router = TestBed.get(Router);
762760
const store: Store<any> = TestBed.get(Store);
763-
const actions$: Actions = TestBed.get(Actions);
761+
// Not using effects' Actions to avoid @ngrx/effects dependency
762+
const actions$: ScannedActionsSubject = TestBed.get(ScannedActionsSubject);
764763
const log: any[] = [];
765764
router.events.subscribe(e => {
766765
if (e.hasOwnProperty('url')) {

0 commit comments

Comments
 (0)