test-events-router

Test SSE router authentication, event emission, and authorization with Vitest.

1|Updated May 21, 2025
One-click install
npx skills add https://github.com/madooei/backend-template --skill test-events-router
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-events-router
Source: https://github.com/madooei/backend-template/tree/main/.claude/skills/test-events-router
Command: npx skills add https://github.com/madooei/backend-template --skill test-events-router

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides automated tests to verify the Server-Sent Events (SSE) router behavior, ensuring authenticated clients receive the correct event streams and that authorization rules are enforced.

Core Features & Use Cases

  • Authentication-focused SSE connection tests
  • Event emission and filtering for multiple resources
  • Authorization scenarios for own vs other users and admin access
  • Header validation and connection lifecycle checks

Quick Start

Run the test suite to validate the SSE router.

Frequently Asked Questions about test-events-router

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

FAQPage Schema
How do I test SSE router functionality and real-time streaming?

Test SSE router functionality by running an automated suite with Vitest and a mock event emitter to verify authenticated clients receive correct event streams and authorization rules are enforced.

How do I test authorization rules for Server-Sent Events in a CI workflow?

Validate authorization rules for Server-Sent Events by checking event emission and filtering for multiple resources, verifying own versus other users access, and testing admin access scenarios within your CI workflow.

Can I use Vitest to validate SSE authentication and connection lifecycle?

Yes, Vitest can validate SSE authentication handling, perform header validation, and execute connection lifecycle checks to ensure authenticated clients maintain proper streaming connections.

What is the best way to verify event broadcasting and resource-based access control in Hono?

Verify event broadcasting and resource-based access control in Hono by implementing automated tests that mock the event emitter and validate access control logic for authenticated streaming.

Does this SSE testing approach work for mocking event emitters without external dependencies?

Yes, this SSE testing approach operates without external dependencies by using a mock event emitter to simulate event broadcasting, allowing you to isolate and test authentication and authorization logic.