# 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.&#x20;

```typescript
describe('HttpService', () => {
    beforeEach(() => {
        NgStateTestBed.setTestEnvironment(new ImmerDataStrategy());
        NgStateTestBed.createStore({test: 'test'});
    });
    
    it('should access store', (done) => {
        Store.store.select(['test']).subscribe(state => {
            expect(state).toEqual('test');
            done();
        });    
    });
});  
```

_`createStore` adds store to dependency injection and also returns it as a value. So you can ue it in your tsts immediately._
