test(mobile): store ()

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-02-21 20:40:42 +05:30 committed by GitHub
commit 94c0e8253a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 399 additions and 14 deletions
mobile/test

View file

@ -21,10 +21,11 @@ import 'mock_http_override.dart';
// Listener Mock to test when a provider notifies its listeners
class ListenerMock<T> extends Mock {
// ignore: avoid-declaring-call-method
void call(T? previous, T next);
}
final class TestUtils {
abstract final class TestUtils {
const TestUtils._();
/// Downloads Isar binaries (if required) and initializes a new Isar db
@ -50,13 +51,14 @@ final class TestUtils {
AndroidDeviceAssetSchema,
IOSDeviceAssetSchema,
],
maxSizeMiB: 1024,
directory: "test/",
maxSizeMiB: 1024,
inspector: false,
);
// Clear and close db on test end
addTearDown(() async {
await db.writeTxn(() => db.clear());
await db.writeTxn(() async => await db.clear());
await db.close();
});
return db;