Open jesusmartinoza opened 2 years ago
Hello, for some reasons using Hive inside testWidgets method doesn't work.
// 📦 Package imports: import 'package:flutter_test/flutter_test.dart'; import 'package:hive/hive.dart'; // 🌎 Project imports: import 'package:hive_test/hive_test.dart'; void main() { testWidgets('initializing, using, and closing a test Hive works', (WidgetTester tester) async { print('Enters here'); await setUpTestHive(); print("Doesn't enters here"); final box = await Hive.openBox<int>('testBox'); await box.add(1); await box.clear(); await tearDownTestHive(); }); }
Changing testWidgets -> to test works.
Any help appreciated. And thanks for this lib <3
Same here, not working in testWidgets
testWidgets
Perhaps try adding it in the setup/teardown?
setUp(() async { await setUpTestHive(); }); tearDown(() async { await tearDownTestHive(); });
Hello, for some reasons using Hive inside testWidgets method doesn't work.
Changing testWidgets -> to test works.
Any help appreciated. And thanks for this lib <3