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 7ff9d47
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')

Check failure on line 18 in jest.setup.js

View workflow job for this annotation

GitHub Actions / Run lint check

Replace `··require('@react-native-async-storage/async-storage/jest/async-storage-mock')` with `↹require('@react-native-async-storage/async-storage/jest/async-storage-mock'),`

Check failure on line 18 in jest.setup.js

View workflow job for this annotation

GitHub Actions / Run lint check

Expected indentation of 1 tab but found 2 spaces
);

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 7ff9d47

Please sign in to comment.