go test $(git ls-files --modified | xargs dirname | uniq | xargs -I '{}' echo "./{}")I work in a Go monolith with many packages, and my patches often span multiple patches. Before I push to CI, I like to test all the packages with changed files, but enumerating all those packages by hand is...
A month ago, I wrote about my Playwright fixture for testing static websites in a browser. I’ve been copying that fixture from project-to-project, but recently I decided to add it to chives, the utility library I use for all my static websites (or tiny archives). One of my rules for chives is that...
Create a new browser context with a narrow screen, then get document.body.scrollWidth to get the width of the displayed page.One perennial source of bugs on this site is incorrect page widths on mobile devices: something isn’t wrapping or cropping properly, and it forces the whole page to be too...
I build a lot of static websites – including this site and all of my local media archives – and I want to test them. Most of my pages are static HTML and I can write automated tests that analyse the HTML, but for more complex sites I have JavaScript that runs in the browser and modifies the page....
Start the server with subprocess.Popen, poll until it’s available, yield the base URL, then clean up the process when you’re done.For local developemnt and testing of this site, I’ve started to run a Caddy server with my real config to be a better replica of my real setup. I wanted to start a...