testbox-cbmockdata

Generate realistic mock data structs and arrays for TestBox tests.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate realistic, varied fake data for unit and integration tests to avoid manual fixture creation and brittle hand-crafted datasets.

Core Features & Use Cases

  • Fluent type-based generation: map field names to type strings such as fname, lname, email, uuid, autoincrement, oneof, and rnd to produce realistic values.
  • Complex structures and factories: produce arrays of objects, nested objects, arrays of scalar values, and integrate custom supplier closures for computed or conditional fields.
  • Use Case: seed test databases, build reusable factory helpers, and create consistent fixtures across TestBox specs and BDD suites.

Quick Start

Use cbMockData to generate a struct or an array of mock records by mapping field names to type strings or closures and specifying $num or $returnType.

Frequently Asked Questions about testbox-cbmockdata

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

FAQPage Schema
How do I generate realistic mock test data for TestBox specs?

Generate realistic mock test data by mapping field names to type strings like fname, lname, email, and uuid within TestBox. This approach produces varied fake datasets, avoiding brittle hand-crafted fixtures for unit and integration tests.

Can I generate arrays of nested objects for test fixtures?

Yes, you can generate arrays of nested objects for test fixtures. By specifying $num or $returnType, the generator produces complex structures including arrays of records, nested objects, and scalar values.

Does WireBox support custom closures for computed mock values?

Yes, WireBox supports custom closures for computed mock values. You can integrate custom supplier closures to produce conditional or computed fields, allowing dynamic value generation within your mock data factories.

What data types are available for generating mock data in ColdBox tests?

Available data types for generating mock data include fname, lname, email, uuid, autoincrement, oneof, and rnd:min:max. These type strings map to field names to produce realistic, varied values for test databases.

What is the best way to build reusable factory helpers for BDD suites?

The best way to build reusable factory helpers for BDD suites is using supplier-based computed values and type-based generation. This creates consistent fixtures across TestBox specs while supporting nested arrays and custom closures.