Skip to content
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

Create mock implementations for react-native-quick-sqlite and idb-keyval #529

Open
chrispader opened this issue Apr 16, 2024 · 1 comment
Assignees

Comments

@chrispader
Copy link
Contributor

chrispader commented Apr 16, 2024

As described in this P/S proposal i want to create mock implementations directly in react-native-quick-sqlite and idb-keyval, which we can then use to improve and add new (unit) tests in Onyx.

Proposal

Create a mock for react-native-quick-sqlite (and idb-keyval) to allow for testing the actual storage providers on different platforms 🧪

Problem

From time to time we experience (sometimes critical) bugs and problems with edge-cases in Onyx and therefore also in E/App. These are often caused by the underlying storage library on (only) one platform, native or web. In Onyx we are only testing the actual library logic, but storage implementation of the underlying storage providers - like SQLite and IndexedDB - remains untested.

Solution

Implement a mock for react-native-quick-sqlite (and idb-keyval) and use it within Onyx for unit and E2E tests. The storage providers we use in Onyx are working very differently but we're trying to use the same similarly for the most part. In order for the library to work the same on all platform, we should test the actual storage provider implementations on all platforms. We can then potentially also improve more exhaustive tests for flows and use-cases in E/App

@tgolen @roryabraham just checking if i can already start working on this, since the proposal got 4 upvotes (2 from Expensify employees) and no downvotes or negative comments.

@tgolen
Copy link
Collaborator

tgolen commented Apr 16, 2024

I think it's fine to start working on this, yeah.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants