diff --git a/modules/store/testing/src/mock_store.ts b/modules/store/testing/src/mock_store.ts index 2fb0138d4f..7a3eb0a249 100644 --- a/modules/store/testing/src/mock_store.ts +++ b/modules/store/testing/src/mock_store.ts @@ -36,7 +36,7 @@ export class MockStore extends Store { >(); public scannedActions$: Observable; - private lastState: T | undefined; + private lastState: T; constructor( private state$: MockState, @@ -47,8 +47,7 @@ export class MockStore extends Store { ) { super(state$, actionsObserver, reducerManager); this.resetSelectors(); - this.state$.next(this.initialState); - this.lastState = this.initialState; + this.setState(this.initialState); this.scannedActions$ = actionsObserver.asObservable(); if (mockSelectors) { mockSelectors.forEach(mockSelector => {