Behaviour was added in 5f68d90.
Couldn't work out the testing approach quickly, but shipped the working feature. Needs some tests adding retroactively.
I tried using sinon to stub the request dependency, but ran in to issues with needing it to yield different values each time - stubbing the response of the first page meant it continually parsed the first page, requested the second, received the first again and repeated forever.
Feels like the right approach is to refactor the fetcher to make the testing easier, possibly to avoid it being aware of request at all.
Behaviour was added in 5f68d90.
Couldn't work out the testing approach quickly, but shipped the working feature. Needs some tests adding retroactively.
I tried using
sinonto stub the request dependency, but ran in to issues with needing it to yield different values each time - stubbing the response of the first page meant it continually parsed the first page, requested the second, received the first again and repeated forever.Feels like the right approach is to refactor the fetcher to make the testing easier, possibly to avoid it being aware of request at all.