{"library":"jest-launchdarkly-mock","type":"library","category":null,"description":"jest-launchdarkly-mock is a utility package designed to simplify unit testing of React components that integrate with LaunchDarkly feature flags. It provides a straightforward API to mock feature flag states and the LaunchDarkly client within Jest test environments, specifically for applications using the `launchdarkly-react-client-sdk`. The current stable version is 2.2.1, with releases occurring periodically to address bugs and support new features of the underlying LaunchDarkly SDKs. Key differentiators include its tight integration with Jest for mocking, its explicit support for React SDK hooks like `useFlags`, and its ability to simulate client-side LaunchDarkly behavior without network calls. It supports LaunchDarkly's custom contexts feature introduced in v2.0.0, which evolved from the 'users' concept. The library is primarily used in TypeScript projects, shipping with its own type definitions.","language":"javascript","status":"active","version":"2.2.1","tags":["javascript","jest","launchdarkly","mock","unit","test","feature","flags","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install jest-launchdarkly-mock","imports":["import { mockFlags } from 'jest-launchdarkly-mock'","import { ldClientMock } from 'jest-launchdarkly-mock'","import { resetLDMocks } from 'jest-launchdarkly-mock'"]},{"cmd":"yarn add jest-launchdarkly-mock","imports":[]},{"cmd":"pnpm add jest-launchdarkly-mock","imports":[]}],"homepage":null,"github":"https://github.com/launchdarkly/jest-launchdarkly-mock","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/jest-launchdarkly-mock","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/jest-launchdarkly-mock/compatibility"}}