frameguard_test library

FrameGuard test helpers, matchers, and synthetic jank utilities.

import 'package:frameguard/frameguard.dart';
import 'package:frameguard/frameguard_test.dart';

Classes

FrameGuardGolden
Golden performance baseline helpers for tests.
FrameGuardMatchers
Namespace for discoverability (FrameGuardMatchers.meetsBudget(...)).
FrameGuardTest
Test helpers for flutter_test and integration_test.
SyntheticJank
Test-only utilities that deliberately create slow frames / rebuild pressure.

Constants

hasNoSevereJank → const Matcher
Matcher: no severe jank frames.

Functions

hasJankRateBelow(double maxRate) Matcher
Matcher: jank rate below maxRate (0–1).
hasP95Below(Duration max) Matcher
Matcher: p95 below max.
hasP99Below(Duration max) Matcher
Matcher: p99 below max.
meetsBudget(FrameBudget budget) Matcher
Alias matching the product-spec name.
meetsFrameBudget(FrameBudget budget) Matcher
Matcher: report meets budget.
writeReportArtifact(FrameGuardReport report, {required String path}) Future<void>
Writes a report JSON beside baselines for review workflows.

Exceptions / Errors

TestFailure
Minimal TestFailure without importing flutter_test in all paths.