diff options
Diffstat (limited to 'packages/demobank-ui/mocks/window.js')
-rw-r--r-- | packages/demobank-ui/mocks/window.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/demobank-ui/mocks/window.js b/packages/demobank-ui/mocks/window.js new file mode 100644 index 000000000..f396ff9e3 --- /dev/null +++ b/packages/demobank-ui/mocks/window.js @@ -0,0 +1,27 @@ +Object.defineProperty(window, 'requestAnimationFrame', { + value: function(cb) {} // Silence the browser. +}) + +Object.defineProperty(window, 'localStorage', { + value: { + store: {}, + getItem: function(key) { + return this.store[key]; + }, + setItem: function(key, value) { + return this.store[key] = value; + }, + clear: function() { + this.store = {}; + } + } +}); +Object.defineProperty(window, 'location', { + value: { + origin: "http://localhost:8080", /* where taler-local rev proxy listens to */ + search: "", + pathname: "/sandbox/demobanks/default", + } +}) + +export default window; |