How to use the ember-window-mock.localStorage function in ember-window-mock

To help you get started, we’ve selected a few ember-window-mock examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kaliber5 / ember-window-mock / tests / dummy / app / components / window-tester.js View on Github external
init() {
    this._super(...arguments);

    this.set('counter', +window.localStorage.getItem('counter') || 1);
  },
github kaliber5 / ember-window-mock / tests / dummy / app / components / window-tester.js View on Github external
increment() {
      this.incrementProperty('counter');
      window.localStorage.setItem('counter', this.get('counter'));
    }
  }

ember-window-mock

Wraps the global window object with a proxy that can be mocked in tests

MIT
Latest version published 4 months ago

Package Health Score

74 / 100
Full package analysis