Continuing from my last few emails, as well as adding the new use case more easily and quicker, having automated tests also saved me from adding a regression into the code I was changing.
I'd written a condition in the query to ensure only results that started with the search term.
Initially, I removed it, but then the tests failed.
This reminded me why I'd written the condition that way, and I was able to re-add my fix differently.
Without the tests, I'd likely have removed it and introduced a regression.
Whilst fixing a bug, I'd have introduced a different bug.
My tests saved me from doing that and I was able to rectify it quickly before pushing to CI or the staging environment.
P.S. Do you need immediate access to an expert Drupal Developer? With my Drupal development subscription, make unlimited requests for a fixed monthly price in less time than posting to a job board!