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

Store: MockReducerManager crashes with reducerManager.addFeatures is not a function #2263

Closed
eddietisma opened this issue Nov 15, 2019 · 0 comments · Fixed by #2265
Closed

Comments

@eddietisma
Copy link
Contributor

eddietisma commented Nov 15, 2019

Minimal reproduction of the bug/regression with instructions:

provideMockStore crashes when using forFeature imports.

  1. Add a module that imports using ngrx forFeature.
StoreModule.forFeature('feature', FeatureReducer),
EffectsModule.forFeature([FeatureEffects]),
  1. Writing a unit test with provideMockStore and import the module.

TypeError: reducerManager.addFeatures is not a function

Stackblitz with repro:
https://stackblitz.com/edit/ngrx-seed-wrbv4t

Expected behavior:

provideMockStore should support feature modules.

platform/modules/store/testing/src/mock_reducer_manager.ts has no-op for addFeatures.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

"@angular-devkit/core": "8.0.1",
"@angular-devkit/schematics": "8.0.1",
"@angular/common": "8.0.0",
"@angular/compiler": "8.0.0",
"@angular/core": "8.0.0",
"@angular/forms": "8.0.0",
"@angular/platform-browser": "8.0.0",
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/router": "8.0.0",
"@ngrx/effects": "8.0.0-rc.0",
"@ngrx/entity": "8.0.0-rc.0",
"@ngrx/router-store": "8.0.0-rc.0",
"@ngrx/schematics": "8.0.0-rc.0",
"@ngrx/store": "8.0.0-rc.0",
"@ngrx/store-devtools": "8.0.0-rc.0",

Other information:

I would be willing to submit a PR to fix this issue

[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

@eddietisma eddietisma changed the title Store:: reducerManager.addFeatures is not a function Store: reducerManager.addFeatures is not a function Nov 15, 2019
@eddietisma eddietisma changed the title Store: reducerManager.addFeatures is not a function Store: MockReducerManager crashes with reducerManager.addFeatures is not a function Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants