Hi HN,<p>I just released my first npm package so wanted to share it here.<p>Pythagora is a Node.js module that creates automated integration tests for MERN/MEAN apps by recording server activity.<p>To integrate Pythagora, you need to paste one line of code to your repository and run the Pythagora capture CLI command. Then, just play around with your app and from all API requests and database queries Pythagora will generate integration tests.<p>When running tests, it doesn’t matter what database is your Node.js connected to or what is the state of that database. Actually, that database is never touched or used —> instead, Pythagora creates a special, ephemeral `pythagoraDb`
database, which it uses to restore the data before each test is executed, that was present at the time when the test was recorded. Because of this, tests can be run on any machine or environment.<p>Also, *if the request updates the database, after the API returns the response, Pythagora checks the database to see if it was updated correctly*.<p>Finally, Pythagora tracks (using istanbul/nyc) lines of code that were triggered during tests, so you know how much of your code is covered.<p>Our goal is to help teams that don’t have time to properly manage their test suite to cover their entire codebase with as little as 1 hour of their time. We tested Pythagora on open source clones of apps like Reddit, IG, etc. and we were able to get to 50% of code coverage within 10 minutes and to 90% within 1 hour of playing around these apps.<p>Feel free to try out the Pythagora npm package - https://www.npmjs.com/package/pythagora<p>And the source code on Github - https://github.com/Pythagora-io/pythagora<p>We’re excited to hear what you think.<p>How do you write integration tests for an API server? Would you consider using Pythagora instead/along with your system?<p>If not, we would love to hear what are your concerns and why this wouldn’t work for you?