DEV Community

Cover image for Unit Testing ColdFusion With TestBox: From Zero to a CI-Passing Test Suite in One Sprint
Deepak Sir
Deepak Sir

Posted on • Originally published at Medium

Unit Testing ColdFusion With TestBox: From Zero to a CI-Passing Test Suite in One Sprint

You can go from no tests to a CI-passing ColdFusion test suite in a single sprint, because the tooling is free, mature, and fast to adopt. TestBox is the standard CFML testing framework from Ortus Solutions — a BDD/TDD framework that ships with a test runner, an assertions and expectations library, and MockBox for mocking and stubbing built in. The one-sprint path is concrete: install TestBox as a dev dependency with box install testbox --saveDev, scaffold a /tests harness, write specs as CFCs extending testbox.system.BaseSpec using the clean describe() / it() / expect() syntax, mock your dependencies with createMock() so units test in isolation, run the suite locally with testbox run from CommandBox, and wire it into CI (GitHub Actions, Jenkins, GitLab) so every push runs the tests and fails the build on a red test. TestBox produces JUnit and other CI-friendly reports out of the box, and free GitHub Actions exist to run it against your chosen ColdFusion engine. This guide is the day-by-day plan to get there in one sprint.
Read More

Top comments (0)