-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Bug Report: You've forgotten to add unit tests to the repo #90
Comments
@xni06 Thank you for raising the issue. We do welcome the contribution if anyone is interested. However, the unit tests will have to be written in our https://github.com/appwrite/sdk-generator As our SDKs are generated from swagger specs, we need to generate relevant tests using the specs as well. We do plan on adding tests to all our SDKs. |
static Future<Profile?> updateProfile(
Account account,
Databases databases,
Profile profile,
) async {
try {
final user = await account.get();
final doc = await databases.createDocument(
databaseId: userDatabaseID,
collectionId: profileCollectionID,
documentId: user.$id,
data: profile.toJson(),
permissions: [Permission.read(Role.users())],
);
return Profile.fromJson(doc.data);
} on AppwriteException catch (e) {
Utils.debLog(e);
return null;
}
}
How can I test this peace of code in the test folder ? |
Inject the dependencies; use https://pub.dev/packages/fake_cloud_firestore; verify/expect the outcome |
@xni06 not working with firebase , I am working with Appwrite Databases |
It's the same principle - fake it |
@xni06 We have now added unit tests with our SDK, we have about 73% test coverage. |
👟 Reproduction steps
Look for unit tests...
👍 Expected behavior
Expect to see some unit tests
👎 Actual Behavior
There aren't any unit tests :-(
🎲 Appwrite version
Version 2.0.x
💻 Operating system
MacOS
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: