hive_test
Initialize a temporary Hive database for testing
π Installation
Install passputter from pub.flutter-io.cn:
dev_dependencides:
hive_test: ^1.0.0
π¨ Usage
In your test's setUp
method, simply run:
setUp(() async {
await setUpTestHive();
});
Then, in the tearDown
method:
tearDown(() async {
await tearDownTestHive();
});
Under the hood, this is a real instance of Hive
. So you can open boxes, perform read/write transactions etc just as you would in an app!
π¨π»βπ» Authors
Libraries
- hive_test
- Easily initialize a temporary
Hive
database for unit and widget tests.