4 ms·
Nock – HTTP mocking and expectations library
- t__crayford 12y agoI've used this library a bunch with decent success. Most recently on an API client for my current product: https://github.com/yeller/yeller_node https://github.com/yeller/yeller_node (see https://github.com/yeller/yeller_node/blob/master/spec/integration/yeller_node_spec.js https://github.com/yeller/yeller_node/blob/master/spec/integ... for the tests in question). Very happy with it so far!
- cmkrnl 12y agoI'd like to lodge a modest complaint about the name. http://doc.urbit.org/doc/nock/tut/1/ http://doc.urbit.org/doc/nock/tut/1/
- codezero 12y agoThis library is a couple years old. I know Urbit is older but is Urbit's nock also as old? edit: yes, at least 5 years old, but bloody esoteric http://moronlab.blogspot.com/2010/01/nock-maxwells-equations-of-software.html http://moronlab.blogspot.com/2010/01/nock-maxwells-equations...
- davidgerard 12y agoI'm sure there's lots of namespace room! And if there isn't, then too bad for Urbit.
- state 12y agoOr too bad for pgte
- deitcher 12y agoI have used this in the past with success. It does its job.
- nailer 12y agoA lot of my current projects have Test Induced Design Damage from having HTTP functionality ripped away from any other processing. This would make my methods shorter and my tests cover more as well.
- mmcclure 12y agoI used this for a few projects a while back and loved it, and looking through the README in Master it seems like a lot has been improved: - Delayed responses. - Delayed connections. - Custom HTTP verbs for ones that don't have convenience methods. - Nock Back I believe recording had just been introduced when I was using the library, but Nock Back is seems like the last piece that brings it on par with the VCR lib I was used to using with Ruby / RSpec projects. It's always nice to scroll through a project you've had a good experience with and see the README has been considerably fleshed out (in a good way).
- general_failure 12y agonock is great and we use it for testing with great success. Also a shout out for hock which gives the same API as mock but useful for mocking external services - https://github.com/mmalecki/hock https://github.com/mmalecki/hock.
- codemod 12y agonock is good.. used it a few times..
- vvoyer 12y agoIf you are looking for a browser solution (ajax mocking): https://github.com/algolia/faux-jax https://github.com/algolia/faux-jax