angular-redux / example-app

Example using @angular-redux/store, @angular-redux/router, and @angular-redux/form together with the Angular CLI
123 stars 101 forks source link

Unit Testing with new features from 6.2.0 #21

Closed SethDavenport closed 7 years ago

SethDavenport commented 7 years ago

Work in progress.

SethDavenport commented 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

DroneKid commented 7 years ago

Looks great!