How to use the algoliasearch-helper.default function in algoliasearch-helper

To help you get started, we’ve selected a few algoliasearch-helper 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 algolia / angular-instantsearch / helpers / setup-jest.ts View on Github external
import "jest-preset-angular";

// stupid workaround for TS
import * as helper from "algoliasearch-helper";
require("algoliasearch-helper").default = helper;

const mock = () => {
  let storage = {};
  return {
    getItem(key) {
      return storage[key] || null;
    },
    setItem(key, value) {
      storage[key] = value;
    },
    removeItem(key) {
      delete storage[key];
    },
    clear() {
      storage = {};
    }