How to use the @splitsoftware/splitio.SplitFactory.mockReturnValue function in @splitsoftware/splitio

To help you get started, we’ve selected a few @splitsoftware/splitio 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 tdeekens / flopflip / packages / splitio-adapter / modules / adapter / adapter.spec.js View on Github external
factory = {
        client: jest.fn(() => ({
          on: onStub,
          getTreatments: jest.fn(() => flags),
          Event: {
            SDK_READY: 'SDK_READY',
            SDK_UPDATE: 'SDK_UPDATE',
          },
        })),
        manager: jest.fn(() => ({
          names: jest.fn(() => names),
        })),
      };

      SplitFactory.mockReturnValue(factory);

      return adapter.configure(
        {
          authorizationKey,
          user: userWithKey,
        },
        {
          onStatusStateChange,
          onFlagsStateChange,
        }
      );
    });