Skip to content

Commit 8bb6640

Browse files
authored
chore: add useAsyncStorage to async-storage-mock.js (#425)
1 parent 9ac0f05 commit 8bb6640

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

jest/async-storage-mock.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ const asMock = {
3434
multiSet: jest.fn(_multiSet),
3535
multiRemove: jest.fn(_multiRemove),
3636
multiMerge: jest.fn(_multiMerge),
37+
useAsyncStorage: jest.fn(key => {
38+
return {
39+
getItem: (...args) => asMock.getItem(key, ...args),
40+
setItem: (...args) => asMock.setItem(key, ...args),
41+
mergeItem: (...args) => asMock.mergeItem(key, ...args),
42+
removeItem: (...args) => asMock.removeItem(key, ...args),
43+
};
44+
}),
3745
};
3846

3947
async function _multiSet(keyValuePairs, callback) {

0 commit comments

Comments
 (0)