2
1 Comment

You can use automated tests for your static website

Most people probably don't test static websites before deployment (except for manually going through a few pages), but it can be beneficial to test them.

What would you even test you ask?

  • Header and footer is present
  • Internal links work
  • External links (still) work
  • Old paid/affiliate links are removed
  • Assets
  • CSS is not broken
  • ...

This is especially useful when using static site generators. I wrote such tests for Fedora Developer website that is built with Jekyll.

Do you test your static websites?

If you are interested I wrote about writing such automated tests in Ruby with Capybara and Webkit.

posted to Icon for group Learning to Code
Learning to Code
on February 24, 2020
  1. 1

    I've never written a formal test harness for my static sites, but the very nature of static sites needing to be compiled lends itself to being a decent smoke test / indicator that things are /mostly/ all right. A jekyll build will fail from bad liquid templates, something borked in the config, etc.

Trending on Indie Hackers
I'm a lawyer who launched an AI contract tool on Product Hunt today — here's what building it as a non-technical founder actually felt like User Avatar 151 comments Never hire an SEO Agency for your Saas Startup User Avatar 83 comments A simple way to keep AI automations from making bad decisions User Avatar 65 comments “This contract looked normal - but could cost millions” User Avatar 54 comments 👉 The most expensive contract mistakes don’t feel risky User Avatar 41 comments We automated our business vetting with OpenClaw User Avatar 34 comments