Hugo + Netlify: best way to add tests

We are hosting a Hugo-generated Documentation site on GitHub. We deploy with Netlify.

Now I want to start adding tests to make sure we don’t break our site with our changes: things like simple HTML validation, testing if a few things are rendering correctly, etc. I assume lots of people are already doing similar things for their sites.

We also use Travis and Codeception on the open-source project for which we’re creating this Documentation, so if I use those technologies I get to enjoy some internal know-how.

So I would appreciate just a couple of quick pointers:

  • in terms of Architecture, how would you go about it? I personally don’t know anything about automated tests, and I am not sure if these should work independently from Netlify, or be integrated into it, etc.

  • can you point me to any site that has some generic tests that I can use as a basis for our work?

Thanks in advance for any help.

I’m not an expert but as far as I know you may write your tests with gulp (for example), then in Netlify you indicate for example gulp as the command to build your site (provided the gulp command triggers a task that builds the site with the hugo command).

There is the gulp-html plugin for basic html validation.

1 Like