
Introducing Pulse — in-app conformance testing for Blazor
I’m building Pulse, a small .NET test runner for conformance tests that run inside a real app host.
For Blazor WebAssembly, the goal is to test behavior that dotnet test can’t honestly prove: real IJSRuntime, imported JS modules, browser storage, host HttpClient, DI, and runtime services while the app is actually running in the browser.
The pattern:
- put shared specs in
*.TestSupport - run them against fakes with
dotnet test - run the same behavior inside a real Blazor app with Pulse
example:
public abstract class TokenStorageSpec
{
protected abstract ITokenStorage Storage { get; }
protected async Task RoundTrips(CancellationToken ct)
{
await Storage.StoreAsync("auth", "abc", ct);
if (await Storage.RetrieveAsync("auth", ct) != "abc")
throw new InvalidOperationException("Token did not round-trip.");
}
}
public sealed class BrowserStorageSuite(ITokenStorage storage) : TokenStorageSpec
{
protected override ITokenStorage Storage => storage;
[PulseCase(TimeoutMs = 5000)]
public Task LocalStorage_round_trips(CancellationToken ct) => RoundTrips(ct);
}
So the fake-backed test proves the rule in dotnet test, and Pulse proves the same rule through the real browser/runtime boundary.
Pulse is intentionally small: one NuGet package, no Blazor-specific package, no Test Explorer integration, no UI framework, and it returns a structured TestRunReport.
It’s preview-stage. I’m still figuring out the right direction before calling it stable. The focus is conformance testing for app/runtime boundaries, not replacing unit tests or UI automation.
Specs/rules: https://github.com/Circuids/Pulse/blob/master/docs/conformance-specs-and-rules.md
GitHub: https://github.com/Circuids/Pulse
NuGet:
Circuids.Pulse
Feedback welcome, especially from people building Blazor apps with JS interop, browser storage, host wiring, or runtime behavior that is awkward to verify in normal tests.