Skip to content

Commit

Permalink
Merge pull request #13967 from margelo/@chrispader/migrate-to-sqlite/…
Browse files Browse the repository at this point in the history
…update-react-native-onyx

Migrate to react-native-quick-sqlite / Update react-native-onyx to 1.0.32
  • Loading branch information
tgolen committed Jan 9, 2023
2 parents c3796bb + 1abf2c6 commit 0732a45
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 30 deletions.
18 changes: 16 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,19 @@ PODS:
- React-Core
- react-native-pdf (6.6.2):
- React-Core
- react-native-performance (4.0.0):
- React-Core
- react-native-plaid-link-sdk (7.4.0):
- Plaid (~> 2.5.1)
- React-Core
- react-native-progress-bar-android (1.0.4):
- React
- react-native-progress-view (1.3.2):
- React-Core
- react-native-quick-sqlite (5.1.0):
- React
- React-callinvoker
- React-Core
- react-native-render-html (6.3.1):
- React-Core
- react-native-safe-area-context (4.4.1):
Expand Down Expand Up @@ -561,7 +567,7 @@ PODS:
- React-jsi (= 0.70.4-alpha.2)
- React-logger (= 0.70.4-alpha.2)
- React-perflogger (= 0.70.4-alpha.2)
- RNCAsyncStorage (1.17.10):
- RNCAsyncStorage (1.17.11):
- React-Core
- RNCClipboard (1.5.1):
- React-Core
Expand Down Expand Up @@ -700,9 +706,11 @@ DEPENDENCIES:
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
- react-native-pdf (from `../node_modules/react-native-pdf`)
- react-native-performance (from `../node_modules/react-native-performance`)
- react-native-plaid-link-sdk (from `../node_modules/react-native-plaid-link-sdk`)
- "react-native-progress-bar-android (from `../node_modules/@react-native-community/progress-bar-android`)"
- "react-native-progress-view (from `../node_modules/@react-native-community/progress-view`)"
- react-native-quick-sqlite (from `../node_modules/react-native-quick-sqlite`)
- react-native-render-html (from `../node_modules/react-native-render-html`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-webview (from `../node_modules/react-native-webview`)
Expand Down Expand Up @@ -845,12 +853,16 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/netinfo"
react-native-pdf:
:path: "../node_modules/react-native-pdf"
react-native-performance:
:path: "../node_modules/react-native-performance"
react-native-plaid-link-sdk:
:path: "../node_modules/react-native-plaid-link-sdk"
react-native-progress-bar-android:
:path: "../node_modules/@react-native-community/progress-bar-android"
react-native-progress-view:
:path: "../node_modules/@react-native-community/progress-view"
react-native-quick-sqlite:
:path: "../node_modules/react-native-quick-sqlite"
react-native-render-html:
:path: "../node_modules/react-native-render-html"
react-native-safe-area-context:
Expand Down Expand Up @@ -983,9 +995,11 @@ SPEC CHECKSUMS:
react-native-image-picker: bf34f3f516d139ed3e24c5f5a381a91819e349ea
react-native-netinfo: 1a6035d3b9780221d407c277ebfb5722ace00658
react-native-pdf: 33c622cbdf776a649929e8b9d1ce2d313347c4fa
react-native-performance: 224bd53e6a835fda4353302cf891d088a0af7406
react-native-plaid-link-sdk: 77052f329310ff5a36ddda276793f40d27c02bc4
react-native-progress-bar-android: be43138ab7da30d51fc038bafa98e9ed594d0c40
react-native-progress-view: 4d3bbe6a099ba027b1fedb1548c2c87f74249b70
react-native-quick-sqlite: a7bd4139fb07194ef8534d1cc14c1aec6daa4d84
react-native-render-html: 96c979fe7452a0a41559685d2f83b12b93edac8c
react-native-safe-area-context: 99b24a0c5acd0d5dcac2b1a7f18c49ea317be99a
react-native-webview: e771bc375f789ebfa02a26939a57dbc6fa897336
Expand All @@ -1001,7 +1015,7 @@ SPEC CHECKSUMS:
React-RCTVibration: eb5fb0bb3d78e31dcaeae5f127c75a7caf4b6af9
React-runtimeexecutor: a8cee6fe3fb7994f07b735c7024a08a4fa5f8446
ReactCommon: 1ebf2df5c764ebb52048e7a1cf42c75a6246171a
RNCAsyncStorage: 0c357f3156fcb16c8589ede67cc036330b6698ca
RNCAsyncStorage: 8616bd5a58af409453ea4e1b246521bb76578d60
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
RNCPicker: 0b65be85fe7954fbb2062ef079e3d1cde252d888
RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140
Expand Down
4 changes: 4 additions & 0 deletions jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ reanimatedJestUtils.setUpTests();
// https://reactnavigation.org/docs/testing/#mocking-native-modules
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');

// We have to mock the SQLiteStorage provider because it uses the native module SQLiteStorage, which is not available in jest.
// Mocking this file in __mocks__ does not work because jest doesn't support mocking files that are not directly used in the testing project
jest.mock('react-native-onyx/lib/storage/providers/SQLiteStorage', () => require('react-native-onyx/lib/storage/providers/__mocks__/SQLiteStorage'));

// Turn off the console logs for timing events. They are not relevant for unit tests and create a lot of noise
jest.spyOn(console, 'debug').mockImplementation((...params) => {
if (params[0].indexOf('Timing:') === 0) {
Expand Down
72 changes: 48 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@
"react-native-image-picker": "^4.10.2",
"react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972",
"react-native-modal": "^13.0.0",
"react-native-onyx": "1.0.29",
"react-native-onyx": "1.0.32",
"react-native-pdf": "^6.6.2",
"react-native-performance": "^2.0.0",
"react-native-performance": "^4.0.0",
"react-native-permissions": "^3.0.1",
"react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#77cc9d42c474a693755941b10ee4c2d6f50e5346",
"react-native-plaid-link-sdk": "^7.2.0",
"react-native-quick-sqlite": "^5.0.3",
"react-native-reanimated": "3.0.0-rc.6",
"react-native-render-html": "6.3.1",
"react-native-safe-area-context": "4.4.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/UnreadIndicatorsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function signInAndGetAppWithUnreadChat() {
}

describe('Unread Indicators', () => {
afterEach(Onyx.clear);
afterEach(() => Onyx.clear());

it('Display bold in the LHN for unread chat and new line indicator above the chat message when we navigate to it', () => {
let renderedApp;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/NetworkTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ beforeEach(() => {
// Wait for any Log command to finish and Onyx to fully clear
jest.advanceTimersByTime(CONST.NETWORK.PROCESS_REQUEST_DELAY_MS);
return waitForPromisesToResolve()
.then(Onyx.clear)
.then(() => Onyx.clear())
.then(waitForPromisesToResolve);
});

Expand Down

0 comments on commit 0732a45

Please sign in to comment.