Create Test Command banner
ruvnet ruvnet

Create Test Command

Testing community intermediate

Description

When the user runs `/create-test [path] [description] [test_type] [components] [tdd_phase]`, execute the following:

Installation

Terminal
claude install-skill https://github.com/ruvnet/QuDAG

README

Create Test Command

When the user runs `/create-test [path] [description] [test_type] [components] [tdd_phase]`, execute the following:

Parameters

    undefined

Execution Steps

Step 1: Validate Parameters

    undefined

Step 2: Generate Test Based on Type

For Unit Tests:

use super::*;
use proptest::prelude::*;
use test_case::test_case;

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_${feature_name}() {
        // TDD RED Phase: This test should fail initially
        // TODO: Implement the actual functionality to make this pass
        
        // Arrange
        let input = setup_test_data();

        // Act
        let result = function_under_test(input);

        // Assert
        assert!(result.is_ok());
        // TODO: Add more specific assertions based on requirements
    }
    
    // Property-based test example
    proptest! {
        #[test]
        fn test_${feature_name}_properties(input: ValidInput) {
            // Test invariants and properties
            let result = function_under_test(input);
            prop_assert!(result.is_ok());
        }
    }
    
    // Helper function
    fn setup_test_data() -> TestData {
        // TODO: Create test data
        unimplemented!("Create test data for ${description}")
    }
}

For Integration Tests:

use qudag_protocol::*;
use qudag_crypto::*;
use qudag_dag::*;
use qudag_network::*;
use tokio::test;
use std::sync::Arc;
use wiremock::{Mock, ResponseTemplate};

#[tokio::test]
async fn test_${feature_name}_integration() {
    // TDD RED Phase: Integration test should fail initially
    // Testing: ${description}
    
    // Setup multi-component test environment
    let test_env = TestEnvironment::new().await;
    
    // Initialize components
    let crypto = Arc::new(CryptoComponent::new());
    let network = Arc::new(NetworkComponent::new());
    let dag = Arc::new(DagComponent::new());
    let protocol = Protocol::new(crypto.clone(), network.clone(), dag.clone());

    // Configure component interactions
    test_env.configure_integration(&protocol).await;

    // Execute multi-component test scenario
    let result = protocol.execute_integrated_operation().await;

    // Verify component state consistency
    assert!(verify_component_states(&crypto, &network, &dag).await);
    
    // Verify