> For the complete documentation index, see [llms.txt](https://vytautas.gitbook.io/ng-state/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vytautas.gitbook.io/ng-state/unit-testing/test-store.md).

# 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.*
