testGoldensOnMac function
- @isTest
- String description,
- WidgetTesterCallback test, {
- bool skip = false,
- Size? windowSize,
A golden test that configures itself as a Mac platform before executing the
given test, and nullifies the Mac configuration when the test is done.
Implementation
@isTest
void testGoldensOnMac(
String description,
WidgetTesterCallback test, {
bool skip = false,
Size? windowSize,
}) {
testGoldens(description, (tester) async {
debugDefaultTargetPlatformOverride = TargetPlatform.macOS;
// Adjust the size of the golden window/image as desired.
tester.viewSize = windowSize;
try {
await test(tester);
} finally {
debugDefaultTargetPlatformOverride = null;
}
}, skip: skip);
}