Raxol.Test.TestHelper (Raxol v0.3.0)

View Source

Provides common test utilities and setup functions for Raxol tests.

This module includes:

  • Test environment setup
  • Mock data generation
  • Common test scenarios
  • Cleanup utilities

Summary

Functions

Captures all terminal output during a test.

Cleans up test resources and resets the environment.

Creates a test component with the given module and initial state.

Sets up a test environment with all necessary dependencies.

Creates a mock terminal for testing.

Simulates a sequence of events on a component.

Generates test events for common scenarios.

Generates test layouts for component positioning.

Generates test styles for component rendering.

Functions

capture_terminal_output(fun)

Captures all terminal output during a test.

cleanup_test_env(context)

Cleans up test resources and resets the environment.

create_test_component(module, initial_state \\ %{})

Creates a test component with the given module and initial state.

setup_test_env()

Sets up a test environment with all necessary dependencies.

Returns a context map with initialized services.

setup_test_terminal()

Creates a mock terminal for testing.

simulate_event_sequence(component, events)

Simulates a sequence of events on a component.

test_events()

Generates test events for common scenarios.

test_layouts()

Generates test layouts for component positioning.

test_styles()

Generates test styles for component rendering.