pokerogue/test/testUtils/mocks/mockLocalStorage.ts
Sirz Benjie a51a504155
[Test] Move test folder out of src (#5398)
* move test folder

* Update vitest files

* rename test/utils to test/testUtils

* Remove stray utils/gameManager

Got put back from a rebase
2025-02-22 22:52:07 -06:00

28 lines
449 B
TypeScript

const mockLocalStorage = (() => {
let store = {} as Storage;
return {
getItem(key: string) {
return store[key];
},
setItem(key: string, value: string) {
store[key] = value;
},
hasOwnProperty(key: string) {
return store.hasOwnProperty(key);
},
removeItem(key: string) {
delete store[key];
},
clear() {
store = {} as Storage;
},
};
});
export default mockLocalStorage;