testing-patterns

Provide Lua unit testing patterns, factories, and mocking strategies for Lust.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/voznik/dotfiles --skill testing-patterns-voznik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/voznik/dotfiles/tree/main/.config/elephant/.rulesync/skills/testing-patterns
Command: npx skills add https://github.com/voznik/dotfiles --skill testing-patterns-voznik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Lua unit testing in Lua projects often requires boilerplate for describes, it blocks, and mocks; this Skill provides patterns, factory helpers, and mocking strategies to streamline TDD.

Core Features & Use Cases

  • Factory pattern helpers to provide sensible defaults and overridable properties.
  • Mocking utilities to spy on function calls and assertions in tests.
  • Structured TDD workflow guidance (red-green-refactor) for repeatable cycles.
  • Practical guidance for writing unit tests in Lua using Lust.

Quick Start

Run your Lua tests with Lust to apply the TDD workflow.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
How do I structure Lua unit tests with describe and it blocks?

Structure Lua unit tests using Lust to organize describe and it blocks, enabling clear test hierarchies. This Skill provides structured TDD workflow guidance and patterns to define before and after hooks for repeatable red-green-refactor cycles.

What's the best way to mock function calls in Lua testing?

Mock function calls in Lua testing using provided mocking utilities to spy on invocations and assertions. These strategies streamline TDD workflows by simulating dependencies without manual boilerplate, ensuring rapid and consistent feedback across Lua projects.

How do I reduce boilerplate when writing Lua tests with Lust?

Reduce Lua test boilerplate by applying factory pattern helpers that supply sensible defaults and overridable properties. This Skill offers reusable test utilities to eliminate repetitive setup code and accelerate TDD cycles with Lust.

Can I follow a TDD red-green-refactor workflow in Lua?

Follow a TDD red-green-refactor workflow in Lua using structured guidance from this Skill. It supports repeatable cycles by providing testing patterns, factories, and mocking strategies to ensure rapid feedback and consistent test design with Lust.

Does Lust support custom assertions for Lua testing?

Lust supports custom assertions for Lua testing, satisfying requirements for reusable test utilities. This Skill leverages Lust to provide structured describe and it blocks alongside mocking strategies to streamline your TDD workflow.