Problem Statement
The SDK tests (xstreamroll-sdk/__tests__/) only test URL configuration resolution. No test calls the actual HTTP methods (login, register, publishEvent, getStreamStatus) against a stub API server.
Evidence
SDK tests mock apiUrl field access but never test actual HTTP calls.
Impact
The SDK's StreamingClient methods are untested beyond constructor config. Auth flow (login, register, refresh, logout), stream operations (publishEvent, getStreamStatus), and error handling have no automated verification.
Proposed Solution
Add integration tests using nock or msw to stub the API:
- Test login with valid credentials → returns AuthTokens
- Test login with invalid credentials → throws ApiError
- Test register with valid data → returns AuthTokens
- Test publishEvent → request body verified
- Test getStreamStatus → response parsed correctly
- Test auto-refresh on 401 → retries with new token
Acceptance Criteria
File Map
xstreamroll-sdk/__tests__/client.integration.test.ts — new
xstreamroll-sdk/package.json — add nock dev dependency
Labels: testing
Priority: Low | Difficulty: Intermediate | Estimated Effort: 1d
Labels: testing
Priority: Low | Difficulty: Intermediate | Estimated Effort: 1d
Backlog ID: REPO-041
Problem Statement
The SDK tests (
xstreamroll-sdk/__tests__/) only test URL configuration resolution. No test calls the actual HTTP methods (login, register, publishEvent, getStreamStatus) against a stub API server.Evidence
SDK tests mock
apiUrlfield access but never test actual HTTP calls.Impact
The SDK's
StreamingClientmethods are untested beyond constructor config. Auth flow (login, register, refresh, logout), stream operations (publishEvent, getStreamStatus), and error handling have no automated verification.Proposed Solution
Add integration tests using
nockormswto stub the API:Acceptance Criteria
File Map
xstreamroll-sdk/__tests__/client.integration.test.ts— newxstreamroll-sdk/package.json— addnockdev dependencyLabels: testing
Priority: Low | Difficulty: Intermediate | Estimated Effort: 1d
Labels: testing
Priority: Low | Difficulty: Intermediate | Estimated Effort: 1d
Backlog ID: REPO-041