Yesterday Marijn van Wezel (Wikibase Solutions) released version 1.0.0 of MWUnit. This extension for MediaWiki provides a unit testing framework for templates, parser functions and other wikitext. It allows people who write technical templates to automatically test those templates and changes to those templates. It ensures that a template, or section of a template, meets its design requirements and behaves exactly as intended.

Read more on the official extension page at with tons of documentation.