Jest not mocking out dependencies?

117 views
Skip to first unread message

aus...@accompani.com

unread,
Jan 21, 2015, 1:40:33 PM1/21/15
to jes...@googlegroups.com
Hey All,

Just started looking at Jest, and immediately hit a wall where the file I'm attempting to test throws an error, which seems to be related to superagent.

Part of whats confusing is that the file I'm testing doesn't require superagent itself, but requires an ActionCreator which requires the Api which requires superagent - looking at the docs I thought that that the dependency chain would have been mocked out?

It seems that there is a fix by directly mocking out superagent (a la http://bl.ocks.org/simenbrekken/b6282f713605b619834f), but wanted to get clarification around whats actually happening under the hood :D

-Austen
Reply all
Reply to author
Forward
0 new messages