pokerogue/test/test-utils/mocks/mock-local-storage.ts
Sirz Benjie 51d4c33de0
[Misc] Standardize-file-names (#6137)
* Standardize filenames to kebab-case

Co-authored-by: pymilkmaiden <cassiopeiamahler56@gmail.com>

* Move script outside of public folder

* Move update_exp_sprites to scripts

* Add ls-lint to lint file and directory names

* Update lefthook.yml to skip merge / rebase on all pre-commit commands

---------

Co-authored-by: pymilkmaiden <cassiopeiamahler56@gmail.com>
2025-07-24 16:38:31 -04:00

26 lines
420 B
TypeScript

export 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;
},
};
};