Skip to content

Commit

Permalink
test(widgets): mock AsyncStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr committed Sep 1, 2023
1 parent d5caa3d commit d9aa28e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions __mocks__/@react-native-async-storage/async-storage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@react-native-async-storage/async-storage/jest/async-storage-mock';
3 changes: 3 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9aa28e

Please sign in to comment.