6 ms·
Does anyone know if there are libraries for writing fakes ? I wonder why there is a lot of mock libraries but I know none for writing fakes.
by ecaradec 3y ago
Does anyone know if there are libraries for writing fakes ? I wonder why there is a lot of mock libraries but I know none for writing fakes.
- regularfry 3y agohttps://github.com/rr/rr https://github.com/rr/rr
- alecthomas 3y ago"Currently RR implements mocks, stubs, proxies, and spies. Fakes usually require custom code, so it is beyond the scope of RR."
- regularfry 3y agoAh yes - I'm getting confused between fakes and stubs. Either way, RR is good to have in the toolbox.
- slayerjain 3y agoYou know, faking stuff in code is a really case-by-case deal. You've got libraries out there like Localstack, for instance, that do a solid job at pretending to be AWS, but finding one solution that fits all? That's tricky, because everyone's needs are a bit different. I've actually messed around with a library that makes stubs by recording external calls to things like APIs or databases. Sure, it can get a little brittle at times, but it's kind of cool because it's using real calls to create these stubs, and you don't have to put in a ton of extra work. Like anything else, it's about weighing the pros and cons and seeing what fits best for your project.
- rleigh 3y agofff - https://github.com/meekrosoft/fff https://github.com/meekrosoft/fff