Dave Farley advises against mocking external dependencies, suggesting that abstractions should be created for systems like Umbraco. Dennis faced challenges while implementing this, ultimately opting to mock the published content model. Through several iterations, they developed a more readable and maintainable testing approach, emphasizing strong typing and clarity in code.
Dennis continues his TDD series by developing an extension for Umbraco's TinyMCE Rich Text Editor to enable tagging members in content, similar to Slack's mention feature. He implements a MentionsManager class using TypeScript and Jest for testing, allowing for fetching and inserting mentions. He reflects on the simplicity and potential improvements of his code structure.
In this article, Dennis discusses the implementation of a business hours feature using Test Driven Development (TDD). Initially, the existing system struggled with irregular hours, prompting a redesign. Through TDD, Dennis successfully defined and tested various use cases, ultimately achieving a functional solution while reflecting on potential improvements in test clarity and user focus.