Last active
December 28, 2021 12:32
-
-
Save blaugold/90678d81d227d4e66e248080f4d00071 to your computer and use it in GitHub Desktop.
This file contains hidden or 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'; | |
import 'package:cbl/cbl.dart'; | |
import 'package:cbl_dart/cbl_dart.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
void main() { | |
// Each test file needs to initialize Couchbase Lite. | |
// It's a good idea to encapsulate that in a util function, | |
// that all tests use. | |
setUpAll(() async { | |
// If no `filesDir` is specified when initializing CouchbaseLiteDart, | |
// the working directory is used as the default database directory. | |
// By specifying a `filesDir` here, we can ensure that the tests don't | |
// create databases in the project directory. | |
final tempFilesDir = await Directory.systemTemp.createTemp(); | |
// Now initialize Couchbase Lite. | |
await CouchbaseLiteDart.init( | |
edition: Edition.community, | |
filesDir: tempFilesDir.path, | |
); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment