How to use the algoliasearch.mockImplementation function in algoliasearch

To help you get started, we’ve selected a few algoliasearch 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 / src / __tests__ / create-ssr-search-client.spec.ts View on Github external
it('passes user agents', () => {
    const addAlgoliaAgent = jest.fn();

    algoliasearch.mockImplementation(() => {
      return {
        addAlgoliaAgent,
      };
    });

    const ssrSearchClient = createSSRSearchClient({
      appId: 'test',
      apiKey: 'test',
      httpClient: null,
      HttpHeaders: null,
      makeStateKey: null,
      transferState: null,
    });

    expect(addAlgoliaAgent).toHaveBeenCalledTimes(3);
    expect(addAlgoliaAgent).toHaveBeenCalledWith(

algoliasearch

A fully-featured and blazing-fast JavaScript API client to interact with Algolia API.

MIT
Latest version published 6 days ago

Package Health Score

85 / 100
Full package analysis