From 7ff9d47d8b3b45b7d2b8aeefda01e855ab11e34e Mon Sep 17 00:00:00 2001 From: Philipp Walter Date: Fri, 1 Sep 2023 13:12:41 +0200 Subject: [PATCH] test(widgets): mock AsyncStorage --- __mocks__/@react-native-async-storage/async-storage.js | 1 + jest.setup.js | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 __mocks__/@react-native-async-storage/async-storage.js diff --git a/__mocks__/@react-native-async-storage/async-storage.js b/__mocks__/@react-native-async-storage/async-storage.js new file mode 100644 index 000000000..69d0e5302 --- /dev/null +++ b/__mocks__/@react-native-async-storage/async-storage.js @@ -0,0 +1 @@ +export * from '@react-native-async-storage/async-storage/jest/async-storage-mock'; diff --git a/jest.setup.js b/jest.setup.js index 8558c3ef0..32f7dcea4 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -14,6 +14,9 @@ jest.mock('react-native-permissions', () => jest.mock('@react-native-community/netinfo', () => mockRNCNetInfo); jest.mock('react-native-localize', () => mockRNLocalize); jest.mock('@synonymdev/react-native-ldk', () => mockLDK); +jest.mock('@react-native-async-storage/async-storage', () => + require('@react-native-async-storage/async-storage/jest/async-storage-mock') +); global.net = require('net'); // needed by Electrum client. For RN it is proviced in shim.js global.tls = require('tls'); // needed by Electrum client. For RN it is proviced in shim.js