Guides
Testing
Run local, smoke, bridge, and QR scenarios with the shared E2E package.
Testing
@onmax/better-auth-nimiq-pay-e2e keeps the direct and QR flows testable without coupling them to one app implementation.
Local and smoke scripts
pnpm test
pnpm test:e2e:smoke
pnpm test:e2e:qr
What the package provides
createLocalAuthFetcher()for deterministic direct sign-in testscreateLocalQrAuthFetchers()for deterministic QR challenge testscreateStubNimiqProvider()for local signing without a real wallet bridgecreateBridgeNimiqProvider()for real mini-app bridge waitsrunSignInScenario()andrunQrSignInScenario()for end-to-end flow assertionsdefineE2EProfile()for one environment-backed config surface
Example profile
profile.ts
import { defineE2EProfile } from '@onmax/better-auth-nimiq-pay-e2e'
const profile = defineE2EProfile({
playgroundUrl: 'http://127.0.0.1:3000',
endpointPrefix: '/nimiq',
qrEndpointPrefix: '/mobile-qr',
})
Example QR scenario
qr-scenario.ts
import { runQrSignInScenario } from '@onmax/better-auth-nimiq-pay-e2e'
const result = await runQrSignInScenario()
Start with local and smoke scenarios in CI. Use bridge runs only when you need to exercise the real mini-app provider surface.