testing library
Testing support for Forge adapter packages and custom adapters.
Import as package:npaw_forge/testing.dart from dev_dependencies code
only. Exposes the platform contract (ForgePlatform,
ForgePlatformVideo, ForgePlatformAdReporter) together with ready-made
recording fakes so adapter tests can assert emitted Forge event sequences
without a real runtime.
Classes
- ForgePlatform
- Internal seam between the public facade and per-platform runtimes. It traffics in plain Dart maps shaped like the forge_core camelCase JSON contract; the public facade owns the typed models.
- ForgePlatformAdReporter
- Per-ad-reporter platform surface mirroring forge_core ad fire calls.
- ForgePlatformVideo
- Per-video platform reporter mirroring the adapterless forge_core surface.
- RecordingForgeAdReporter
- Recording ForgePlatformAdReporter fake: appends each ad fire call to events (optionally mirroring into a shared sink) and remembers the last metadata map per call.
- RecordingForgePlatform
- Recording ForgePlatform fake: accepts every facade call, remembers the metadata passed to createVideo, and returns platformVideo for every created video view.
- RecordingForgePlatformVideo
- Recording ForgePlatformVideo fake: appends each video fire call to events, remembers the last metadata map, and hands out RecordingForgeAdReporters whose events mirror into events too.
Exceptions / Errors
- ForgeInitException
- Thrown when Forge runtime creation fails (invalid config or contained native panic).