Skip to content

Commit

Permalink
Mock improvements to avoid false negatives (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidferreira authored Aug 16, 2024
1 parent 5f59b57 commit 92a6e47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jest/memoryStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const mock = (): boolean => {
mmkvJsiModule.getStringMMKV = (key, id) => {
if (!MEMORY_STORE[id]) return undefined;
let value = MEMORY_STORE[id].storage[key];
if (!value) return null;
if (typeof value != 'string') return null;
return value;
};

Expand All @@ -138,7 +138,7 @@ export const mock = (): boolean => {
mmkvJsiModule.getNumberMMKV = (key, id) => {
if (!MEMORY_STORE[id]) return undefined;
let value = MEMORY_STORE[id].storage[key];
if (!value) return null;
if (typeof value != 'number') return null;
return value;
};

Expand All @@ -152,7 +152,7 @@ export const mock = (): boolean => {
mmkvJsiModule.getBoolMMKV = (key, id) => {
if (!MEMORY_STORE[id]) return undefined;
let value = MEMORY_STORE[id].storage[key];
if (!value) return null;
if (typeof value != 'boolean') return null;
return value;
};

Expand Down

0 comments on commit 92a6e47

Please sign in to comment.