-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
What is the current behavior?
If adding a single meta reducer, the initial state from the config fails to populate.
Expected behavior:
The initial state should be set in both cases.
Minimal reproduction of the problem with instructions:
Add the following test to modules.spec.ts. When adding the simplest no-op meta reducer, the initial state fails to populate.
describe(`: With initial state`, () => {
const initialState: RootState = { fruit: 'banana' };
const reducerMap: ActionReducerMap<RootState> = { fruit: rootFruitReducer };
const noopMetaReducer = (r: any) => r;
const testWithMetaReducers = (metaReducers: any[]) => () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [StoreModule.forRoot(reducerMap, { initialState, metaReducers })],
});
store = TestBed.get(Store);
});
it('should have initial state', () => {
store.take(1).subscribe((s: any) => {
expect(s).toEqual(initialState);
});
});
};
describe('should add initial state with no meta reducers', testWithMetaReducers([]));
describe('should add initial state with a simple no-op meta reducer', testWithMetaReducers([noopMetaReducer]));
});Version of affected browser(s),operating system(s), npm, node and ngrx:
@ngrx/store@4.0.2/ master branch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels