Unit Testing in Umbraco 9-10.x
The other day I got a friendly heads up from Umbraco Documentation Team member Sofie Toft that the official Umbraco Unit Testing documentation had not yet been verified against the latest major version of Umbraco (v10).
Since I am the original author of this page it was nice of Sofie to remind me about this since I had totally forgot it. But today I finally came around to verify it and I was a bit surprised when I found that... *cliffhanger*
Side note: My original headline for this blogpost was:
"He was going to update the Umbraco Unit Documentation and you will never believe what happened next!"
But it felt a bit cheesy so I changed it last minute. 😂
That's right. All tests from the v9 examples works just as fine in v10, so all I had to do was update the introduction text (which had some references to v9) and add a versionTo: 10.1.0 header to this page.
Pull request to the Umbraco Documentation can be found here.
NEW: Example project for Unit Testing Umbraco 9-10.x
I've mentioned previously that I have an example project on GitHub with all the Umbraco v8 Unit Tests from the official documentation gathered in one smooth project that you can just clone and run (with close to 40 GitHub stars, thank you for that!).
This project was also part of my Codegarden talk back in 2021, video recording can be found here. But since then both Umbraco 9 and 10 have been released and I've had on my todo to bring this example project to the lastest version of Umbraco but time has not been my friend lately. Until now!
So here is, The brand new:
Unit Testing Umbraco (for v9-10+) project!
It consists of only one single project but it includes all the code & test samples from the Umbraco Unit Testing documentation for v.10 so you can see exactly which namespaces and dependencies are needed to get started with Unit Testing in your next Umbraco project. It also has quicklinks to all the different components being tested.
Hopefully it helps someone, somewhere, sometime.
Take care of each other.
Cheers friends! ❤️