Redix LogoDocumentation
API ReferenceUtilities

Test

Run a comprehensive test suite to verify Redis connection and functionality

Syntax

Redix.Test()

Parameters

Prop

Type

Returns

Prop

Type

Description

Runs a complete test suite that verifies:

  • Redis connection
  • Basic key-value operations
  • Hash operations
  • List operations
  • Set operations
  • Sorted set operations
  • Counter operations
  • JSON operations (if Redis Stack is available)
  • Pub/Sub functionality

Example

-- Run full test suite
Redix.Test()

Output Example

[Redix Test Suite]
✓ Connection test
✓ Key-value operations
✓ Hash operations
✓ List operations
✓ Set operations
✓ Sorted set operations
✓ Counter operations
✓ JSON operations
✓ Pub/Sub operations
All tests passed!

Use Cases

Development Setup Verification

RegisterCommand('redis:test', function(source, args, rawCommand)
    if IsPlayerAceAllowed(source, 'admin') then
        Redix.Test()
    end
end, true)

On Resource Start

AddEventHandler('onResourceStart', function(resourceName)
    if GetCurrentResourceName() == resourceName then
        print('[Redix] Running test suite...')
        Redix.Test()
    end
end)

Use this command to verify your Redis installation and Redix configuration are working correctly.