You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thanks for all the work on the Salesforce Mobile SDK! My team uses it in several of our apps, and it handles a lot of the heavy lifting for us when it comes to syncing and data management—so it’s a crucial part of our application.
As of now, our apps don’t have unit tests, and I’m looking to change that. However, I want to approach it in the correct way and ensure we're following best practices when testing code that depends on the SDK.
I couldn't find any guidance on this topic in the documentation or existing GitHub issues, so I wanted to ask:
How do you recommend users of the SDK design and write unit tests?
Should we mock the SDK components (e.g., SmartStore, SyncManager)? If so, do you provide any built-in ways to facilitate this?
Would it be feasible to create a copy of the database and use that for testing, or would that approach introduce complications?
Are there any example test cases or repos that showcase best practices for testing code that integrates with the SDK?
Any guidance on this would be really helpful as we work towards improving our test coverage.
Thanks!
The text was updated successfully, but these errors were encountered:
We do not have documentation specifically on that topic.
We could check out our tests in the repo - most are for testing the SDK directly but a few exercise sample apps using the SDK:
Mocking can be tricky given our (over)reliance on singletons.
I would setup the data you need in your tests instead of copying a database which could lead to some challenges with encryption keys.
Hi Team,
First off, thanks for all the work on the Salesforce Mobile SDK! My team uses it in several of our apps, and it handles a lot of the heavy lifting for us when it comes to syncing and data management—so it’s a crucial part of our application.
As of now, our apps don’t have unit tests, and I’m looking to change that. However, I want to approach it in the correct way and ensure we're following best practices when testing code that depends on the SDK.
I couldn't find any guidance on this topic in the documentation or existing GitHub issues, so I wanted to ask:
How do you recommend users of the SDK design and write unit tests?
Should we mock the SDK components (e.g., SmartStore, SyncManager)? If so, do you provide any built-in ways to facilitate this?
Would it be feasible to create a copy of the database and use that for testing, or would that approach introduce complications?
Are there any example test cases or repos that showcase best practices for testing code that integrates with the SDK?
Any guidance on this would be really helpful as we work towards improving our test coverage.
Thanks!
The text was updated successfully, but these errors were encountered: