Last active
August 24, 2021 05:43
-
-
Save Benson194/6f0adbb8d8507dc9a2c8462650feb5fc to your computer and use it in GitHub Desktop.
Golden Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
void homeScreenTest() { | |
late Directory currentDirectory; | |
setUp(() { | |
currentDirectory = Directory.current; | |
}); | |
group('Mock HomeScreen\n', () { | |
testWidgets('3. Golden test', (WidgetTester tester) async { | |
await tester.pumpWidget(homeScreen); | |
await expectLater( | |
find.byWidget(homeScreen), | |
matchesGoldenFile( | |
'${currentDirectory.path}/test/screens/home_screen/home_screen_test.png')); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment