Skip to content

How to mock a whole store? #97

Answered by zuriscript
jaytonic asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jaytonic

Thanks a lot for starting this discussion.
Sidenote: In the docs I have covered how to test a store in isolation.
This would also include testing for advanced flows like signal changed value propagation etc. which is well covered in signalstory own test suite.

When mocking a store with exposed signals to the outside world, I would mock the signal return value, but otherwise let it stay a signal to conserve the inner mechanics. I guess, especially including getter semantics, this makes it a bit more involved to configure the testing libraries accordingly.

I have answered your specific question on stackoverflow. I don't have much experience with jest-auto-spies, though.

Essenti…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jaytonic
Comment options

Answer selected by jaytonic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants