Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Mock API for testing

Hi, All, My GM & sous-GM aren't exactly software engineers, but they've put together a lot of very useful scripts to streamline our game. They ran into some trouble, though, troubleshooting when things weren't going right. &nbsp;In order to reduce the amount of game-time everyone spent debugging, I volunteered to help them set up unit tests, a CI system, and other elements of a professional workflow. In doing this, I repeatedly came across Davout's excellent thread here: &nbsp; <a href="https://app.roll20.net/forum/post/431906/testing-h" rel="nofollow">https://app.roll20.net/forum/post/431906/testing-h</a>... and used his boilerplate function definitions that match the Roll20 API. But sometimes we needed something that functioned a bit more like the live Roll20 API, just offline. &nbsp;So I rolled up a brute-force implementation for testing purposes:&nbsp; <a href="https://github.com/unexre/RollTwentyMock" rel="nofollow">https://github.com/unexre/RollTwentyMock</a> It's not very pretty, it's not very efficient, but it may help other folks who want to run some tests on their scripts. I also recognize this could be a sensitive topic for the Roll20 staff, and will gladly delete it all if it in any way makes them uncomfortable. Hope this helps someone else, UER
1468041947
Lithl
Pro
Sheet Author
API Scripter
I seem to recall Aaron had written a function that generates a UUID in the same format Roll20 uses, but when it comes to offline script testing, a regular UUID is probably just fine.