coldbox-testing-handler

Test ColdBox event handlers and controllers with BaseTestCase and BaseHandlerTest.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill coldbox-testing-handler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coldbox-testing-handler
Source: https://github.com/ColdBox/skills/tree/main/coldbox/testing-handler
Command: npx skills add https://github.com/ColdBox/skills --skill coldbox-testing-handler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables developers to validate ColdBox event handlers and controllers by executing events, asserting outcomes, and verifying rendering behavior without requiring a full application load.

Core Features & Use Cases

  • Isolated handler unit tests using BaseHandlerTest to test handlers without a running ColdBox app
  • Integration-style tests using BaseTestCase to exercise handlers with a virtual ColdBox app
  • Assertions for rc/prc values, currentView, renderData, and relocation behavior after actions
  • Mocking and injection workflows to verify dependencies are wired correctly in handlers

Quick Start

Create a spec that executes a ColdBox event with execute(), set up mocks, and assert the handler's output, view, and relocation results.

Frequently Asked Questions about coldbox-testing-handler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test ColdBox handlers in isolation without loading the full application?

Isolated handler testing uses BaseHandlerTest to execute events and assert outcomes without a running ColdBox app. You can verify rc/prc values, currentView, renderData, and relocation behavior directly from your unit test specs.

What is the difference between BaseHandlerTest and BaseTestCase for ColdBox unit testing?

BaseHandlerTest runs isolated handler unit tests without a running ColdBox app, while BaseTestCase executes integration-style tests with a virtual ColdBox application. Both support mocking dependencies and asserting event handler outputs.

How do I mock dependencies when testing a ColdBox event handler?

ColdBox handler testing supports mocking and injection workflows to verify dependencies are wired correctly. You set up mocks, execute the event with execute(), and assert the handler's output, view, and relocation results.

Can I assert view rendering and relocate behavior in ColdBox handler tests?

Yes, ColdBox handler tests assert currentView, renderData, and relocation behavior after event actions. You execute events using virtual requests and verify routing outcomes and view rendering results within your specs.

Do I need a running ColdBox application to execute and test event handlers?

No, isolated handler tests using BaseHandlerTest validate handlers without requiring a full application load. Integration-style tests using BaseTestCase can also exercise handlers with a virtual ColdBox app rather than a live instance.