mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
24 lines
452 B
JavaScript
24 lines
452 B
JavaScript
/* eslint-disable import/no-commonjs */
|
|
require('../../../../test/helpers/globals.helper.js');
|
|
|
|
// Shim localStorage
|
|
const localStorage = {
|
|
data: {},
|
|
getItem (key) {
|
|
return this.data[key];
|
|
},
|
|
setItem (key, value) {
|
|
this.data[key] = value;
|
|
},
|
|
removeItem (key) {
|
|
delete this.data[key];
|
|
},
|
|
};
|
|
|
|
Object.defineProperty(window, 'localStorage', {
|
|
value: localStorage,
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
});
|