Introducing yakbak: Record and playback HTTP interactions in Node.js
code.flickr.net
code.flickr.net
Yes, if you change your API you need to update your tests anyway.
---
I haven't played with it or looked at the code, but the only advantage I see is speed of writing tests: hit run, store the "tape" and you don't have to write any specific mocks (which makes it very good imo). Except when you want to test edge cases (specific error messages from the server, time outs during response, errors on the network level, etc).
I wouldn't talk about the speed since it should be the same as a traditional mock.
> Look, no implementation details!
Isn't the HTTP module considered stable? So your API is more likely going to change then node's HTTP implementation (when was the last time this changed?). In which case you need to record new tapes anyway.
And if you mock your responses you can easily edit it to update it to the latest version of the API.
This "tape" approach leaves you with a bunch of opaque blobs that may or may not be easy to recreate or update, since they require a server to be in a specific state to create them in the first place.
Yep, these features are definitely on our roadmap. This is one of the reasons we chose node modules as a tape format: it's just javascript. For example, if you want to add a delay, simply edit your tape and wrap res.end in a setTimeout. Additionally, I want to [make it so tapes format the response according the content-type][1] so that you can easily edit them by hand and have complete control over the response.
It's simply a new approach to a solved problem, it seems.
https://github.com/realestate-com-au/pact https://github.com/DiUS/pact-consumer-js-dsl
`diffy` is a reverse proxy which multiplex requests to multiple endpoints, compare differences and detect regressions between responses.
`gor` is about interception your production traffic (it is not a proxy, more like a network analyzer), continuously, and replaying it on demand to your test environments (you can modify and filter this traffic using various ways).
Hope it helps.
PS. I'm Gor author.