But it wasn't until a poor soul opened an issue in Github (which made me feel horrible) that I realized how much responsibility people writing the docs have. So I decided I had a to do something for my next project, and I did. Every snippet of code should be tested, see this as an example: https://serverjs.io/documentation/context/#-options
const mid = ctx => {
expect(ctx.options.port).toBe(3012);
};
/* test */
const res = await run({ port: 3012 }, mid, () => 200).get('/');
expect(res.status).toBe(200);
In the build process, that snippet will be captured, the test extracted and run. That way, as a one-man dev, I can make sure that my snippets are tested and working automatically. I've gotten busy since then and haven't had the chance to refactor the code or test all the examples as I'd love, but many of those tests are still there, making sure the code examples are working.