testing library
Testing helpers for apps and packages built on Prism.
Kept in a separate entry point so package:prism_kit/prism.dart stays free
of a test-only dependency. Your app already has flutter_test in
dev_dependencies, which is the only place this library is used.
import 'package:prism_kit/testing.dart';
testWidgets('the dashboard shows an empty state', (tester) async {
await pumpPrism(tester, const Dashboard(), size: const Size(320, 568));
expect(find.text('Nothing here yet'), findsOneWidget);
});
The value here is that Prism's own test suite uses exactly these helpers, so your tests exercise the same environment — including the parts that are easy to get wrong, like a viewport that is not zero-sized and a design system that is actually installed.
Constants
-
prismTestSizes
→ const Map<
String, Size> - Sizes worth testing any adaptive component at.
Functions
-
prismTestApp(
{required Widget child, PrismTokens? tokens, Brightness brightness = Brightness.light, Size? size, TextDirection textDirection = TextDirection.ltr, bool reduceMotion = false, ThemeData? theme}) → Widget -
Wraps
childin a fully configured Prism environment, ready to pump.