fixing rn jest tests

This commit is contained in:
balzack 2023-05-05 21:32:37 -07:00
parent 0fa341796f
commit 82e15f5ec7
4 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,3 @@
export default {
createThumbnail: jest.fn(),
}

View File

@ -0,0 +1,3 @@
export default {
readFile: jest.fn(),
}

View File

@ -73,6 +73,9 @@
},
"jest": {
"preset": "react-native",
"setupFiles": [
"<rootDir>/__mocks__/react-native-fs.js"
],
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native(-.*)?|@react-native(-community)?)/)"
]

View File

@ -22,6 +22,8 @@ export function useTestStoreContext() {
init: async () => {
return null;
},
updateDb: async () => {
},
setSession: async (access) => {
},
clearSession: async () => {
@ -147,6 +149,12 @@ export function useTestStoreContext() {
getChannelTopicItems: async (guid, channelId) => {
return [];
},
getChannelTopicItemsId: async (guid, channelId) => {
return [];
},
getChannelTopicItemsById: async (guid, channelId, topcis) => {
return [];
},
setChannelTopicItem: async (guid, channelId, topic) => {
},
setChannelTopicItemUnsealedDetail: async (guid, channelId, topicId, revision, unsealed) => {
@ -196,7 +204,13 @@ export function useTestStoreContext() {
getCardChannelTopicItems: async (guid, cardId, channelId) => {
return [];
},
},
getCardChannelTopicItemsId: async (guid, cardId, channelId) => {
return [];
},
getCardChannelTopicItemsById: async (guid, cardId, channelId, topics) => {
return [];
},
setCardChannelTopicItem: async (guid, cardId, channelId, topic) => {
},
setCardChannelTopicItemUnsealedDetail: async (guid, cardId, channelId, topicId, revision, unsealed) => {