Test store
In order to test places (e.g. http or auth service) where store is accessed directly without action you need to create store.
describe('HttpService', () => {
beforeEach(() => {
ReactStateTestBed.setTestEnvironment(new ImmerDataStrategy());
ReactStateTestBed.createStore({test: 'test'});
});
it('should access store', (done) => {
Store.store.select(['test']).subscribe(state => {
expect(state).toEqual('test');
done();
});
});
});
Last updated
Was this helpful?