You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: abstract platform dependencies for testability and add auth tests (#526)
# Add Testing Utilities for Edge Worker Platform Abstraction
This PR adds a new `/testing` entry point to the edge-worker package that provides utilities for testing Supabase platform integrations. The key improvements include:
1. Created a platform dependency abstraction layer that decouples the SupabasePlatformAdapter from Deno globals
2. Added a `configurePlatform()` utility for overriding platform dependencies in tests
3. Implemented comprehensive unit tests for SupabasePlatformAdapter
4. Added E2E tests for authorization validation in production environments
The implementation:
- Extracts platform dependencies (env, serve, shutdown, etc.) into a dedicated interface
- Provides a default implementation using Deno globals
- Allows tests to override these dependencies without mocking globals
- Includes a new auth_test edge function for E2E testing of authorization
This approach makes the edge worker more testable while maintaining the same runtime behavior in production.
0 commit comments