Stratal API Reference
    Preparing search index...

    TestWsRequest

    Builder for WebSocket upgrade requests. Follows the TestHttpRequest pattern.

    const ws = await module.ws('/ws/chat').connect()
    ws.send('hello')
    await ws.assertMessage('echo:hello')
    ws.close()
    const ws = await module.ws('/ws/chat').actingAs({ id: user.id }).connect()
    
    Index

    Constructors

    Methods

    • Set the locale for this WebSocket connection. If strategy is not provided, resolves from the module's I18n configuration.

      Parameters

      • locale: string
      • Optionalstrategy: DetectionStrategy

      Returns this