-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
Whether you need a mock server or not very much comes down to the app you are testing, the networking code you have written and your individual testing philosophies.
When your app contains networking code that's easy to inject into or you are not too worried about testing the networking layer, it's often simpler to just inject mocks that can take over and pretend to be the server. This avoids networking completely.
But sometimes the code's old, written by someone who hasn't given testing much consideration, or you simply want to be sure that every single layer in your app is tested. Then a mock server becomes a good idea.
You can't.
Any mock server (or injected mock) is only going to be as good as the setup you give it and that will only change when you change it. So using a mock server will mean an on-going tech debt in terms of maintaining the setup and data it uses.
Simply because I've never found one that had all the featured I was looking for. Namely, fast, usable for both iOS and Android, parallel friendly, templatible responses, path arguments, dynamic responses, etc, etc.
None of the offerings I found matched my criteria, most missing more than a few. So having built a number of custom mock servers for clients over the years, I decided to build a more generic one that could be used for any number of projects.
Hence Voodoo, which is designed to take all the features I could never find and make them as easy to use as possible.
To build this project I used a number of 3rd party projects. However you don't need to worry about these as the build will download them as needed. but FYI, here is a list of what Voodoo is built around and the features they provide:
-
Hummingbird - A very fast and well written Swift NIO based server - This is the core that Voodoo is built around.
-
Yams - An API to read YAML configuration files.
-
JXKit - A facade to Swift's JavascriptCore and it's Linux equivalent so that Voodoo can run on both platforms.
-
Nimble - Simply the best assertion framework for unit testing. Not a direct dependency, just used to test Voodoo.
-
Swift Argument Parser - The API that the command line program is built on.
-
AnyCodable - Allows
Anyto beCodable. Used extensively to handle response payloads. -
GraphQL - Provides all the GraphQL parsing so that queries can be matched.