Closed SethDavenport closed 7 years ago
@e-schultz @bronzovik related to our discussion from the other day about making it easier to mock NgRedux/store for unit testing.
The idea would be to move the NgReduxTestingModule
currently in the testing
folder into @angular-redux/store
itself; I'm just proving it out in the example app currently.
This way, you just add NgReduxTestingModule
to your TestBed imports
, and it gives you properly set-up mocks for NgRedux and DevToolsExtension, which work for @select
components as well.
Then you can either
select/@select
and dispatch
using MockNgRedux.spyOnSelect/MockNgRedux.spyOnDispatch
(which return Jasmine Spies)select
calls using MockNgRedux.registerSelection('foo', ['mock', 'foo', 'value', 'stream'])
Looks great!
Work in progress.