DEV Community

Discussion on: Testing Svelte stores and mocking dependencies

Collapse
 
jeffwscott profile image
Jeff Scott

Me again :)

What is the purpose of removing the stubbing and adding rewire$fetch?

There is now no way to mock the return value of fetch which I thought was the point.

I think I may be a bit lost.

Collapse
 
jeffwscott profile image
Jeff Scott

I'm wondering if it's because you split the testing of the store out to it's own spec and you test the fetch in there. Then you don't need to retest that in the Component spec.. Is that correct?

Collapse
 
d_ir profile image
Daniel Irvine šŸ³ļøā€šŸŒˆ

Correct :)

šŸ¤£

I think I confused this by aliasing fetch as fetchPrice, but leaving rewire$fetch instead of naming that rewire$fetchPrice.

Thanks for this feedback. I need to work on this a little!