Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

unit tests #11

Open
gforceg opened this issue Dec 27, 2019 · 3 comments
Open

unit tests #11

gforceg opened this issue Dec 27, 2019 · 3 comments

Comments

@gforceg
Copy link

gforceg commented Dec 27, 2019

This lib is really great, but I'm trying to make an effort to unit test all of my code and I was hoping to find examples of unit tests. Specifically the DI piece and mocking the NGXS pieces.

When my component constructor takes in the store as a constructor and I import NgxsModule.forRoot([MyState]) in the TestBed my tests still fail w/ "Can't resolve all parameters for ".

This would be a great repo to show how to unit test an app that uses NGXS including mocking.

@splincode
Copy link
Member

@markwhitfeld @arturovt

@gforceg
Copy link
Author

gforceg commented Dec 27, 2019

I was complicating things by using jest w/ the jest-presets-angular package and experimental decorators were turned off which screwed up the DI in my testbed. I feel a lot more sane now that the DI is working and I can mock Store.

Still, I think adding unit tests to the examples is a good idea and I'm willing to contribute to this repo personally.

@markwhitfeld
Copy link
Member

Thanks @gforceg, I welcome any contributions you would like to make to this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants