Skip to Content
SPAPS is proprietary hosted SaaS. Paid access required; pre-1.0 contracts may change. Terms and access
GuidesTesting And TDD

Testing With Hosted Staging

Use a hosted staging application for integration tests. Keep unit tests fast with mocks around your own SPAPS adapter, then use a small staging suite to prove the real authentication and entitlement contract.

Test Layers

LayerTargetRecommended proof
UnitYour adapter and business rulesMock client responses and error cases
ContractHosted staging applicationVerify key type, origin, auth, and response shape
BrowserYour app plus hosted stagingSign in and exercise one protected user flow
ServerYour backend plus hosted stagingExercise one privileged call without exposing the secret

Environment

SPAPS_API_URL=https://api.sweetpotato.dev SPAPS_API_KEY=spaps_sec_your_staging_key

Use synthetic staging users and idempotent test data. Never copy production credentials or personal data into test configuration.

A mocked test proves your code. It does not prove credentials, allowed origins, deployed API behavior, or application-scoped token matching. Keep at least one focused hosted-staging contract test.

Promotion Gate

Before switching to production credentials, prove:

  1. publishable-key requests reject unlisted origins;
  2. secret-key requests originate only from your server;
  3. an application-bound token from another application is rejected;
  4. refresh and logout update the user session as expected;
  5. entitlement denial and success paths both behave correctly.

Next