crude-functions-testing

Document Crude Functions testing patterns with TestSetupBuilder and SurrealDB-based integration tests.

Updated Dec 31, 2025
One-click install
npx skills add https://github.com/Xkonti/crude-functions --skill crude-functions-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crude-functions-testing
Source: https://github.com/Xkonti/crude-functions/tree/main/.claude/skills/crude-functions-testing
Command: npx skills add https://github.com/Xkonti/crude-functions --skill crude-functions-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill documents testing best practices for Crude Functions projects, focusing on real infrastructure tests, parallel test execution, and careful resource cleanup to ensure fast, reliable test suites.

Core Features & Use Cases

  • Provides guidance on using TestSetupBuilder to create isolated test environments with real SurrealDB databases, migrations, and multiple services that mirror production.
  • Recommends patterns for integration tests, deferred data, and robust cleanup to prevent resource leaks in a shared testing environment.
  • Describes test structure, anti-patterns, and strategies for avoiding race conditions in parallel test runs.

Quick Start

To start applying these practices, review TestSetupBuilder usage and the integrationTest wrapper, then run the project's test suite in your environment. Use absolute paths and try-finally blocks to ensure resources are always released.

Frequently Asked Questions about crude-functions-testing

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

FAQPage Schema
How do I structure integration tests for Crude Functions using SurrealDB?

Use TestSetupBuilder to construct isolated test environments with real SurrealDB databases, applying the integrationTest wrapper to manage deferred data and ensure robust resource cleanup.

What's the best way to avoid race conditions in parallel test runs with SurrealDB?

Avoid race conditions in parallel test runs by controlling migrations and global state, using try-finally blocks for resource release, and managing deferred data carefully to prevent resource leaks in shared SurrealDB testing environments.

When do I need integration tests instead of mocking for Crude Functions?

You need integration tests when validating interactions with real SurrealDB databases and multiple mirroring services, ensuring reliable test results that mocking cannot accurately replicate.

How do I manage resource cleanup and deferred data in a parallel testing environment?

Manage resource cleanup in parallel testing by using try-finally blocks with absolute paths to ensure resources are always released, carefully handling deferred data to prevent leaks in shared SurrealDB test infrastructures.

Does TestSetupBuilder support running multiple services that mirror production?

TestSetupBuilder supports creating isolated test environments with real SurrealDB databases, migrations, and multiple mirroring services for comprehensive integration testing.