|
| 1 | +# LaunchDarkly Jest |
| 2 | + |
| 3 | +[![NPM][jest-npm-badge]][jest-npm-link] |
| 4 | +[![Actions Status][jest-ci-badge]][jest-ci] |
| 5 | +[![Documentation][jest-ghp-badge]][jest-ghp-link] |
| 6 | +[![NPM][jest-dm-badge]][jest-npm-link] |
| 7 | +[![NPM][jest-dt-badge]][jest-npm-link] |
| 8 | + |
| 9 | +> [!CAUTION] |
| 10 | +> This library is a beta version and should not be considered ready for production use while this message is visible. |
| 11 | +
|
| 12 | +> **Easily unit test LaunchDarkly applications with jest** :clap: |
| 13 | +
|
| 14 | +For more information, see the [complete reference guide for unit testing](https://docs.launchdarkly.com/guides/sdk/unit-tests). |
| 15 | + |
| 16 | +## Installation |
| 17 | + |
| 18 | +```shell |
| 19 | +# npm |
| 20 | +npm i @launchdarkly/jest --save-dev |
| 21 | + |
| 22 | +# yarn |
| 23 | +yarn add -D @launchdarkly/jest |
| 24 | +``` |
| 25 | + |
| 26 | +Then in `jest.config.js` add `@launchdarkly/jest/{framework}` to setupFiles: |
| 27 | + |
| 28 | +```js |
| 29 | +// jest.config.js |
| 30 | +module.exports = { |
| 31 | + // for react |
| 32 | + setupFiles: ['@launchdarkly/jest/react'], |
| 33 | + |
| 34 | + // for react-native |
| 35 | + setupFiles: ['@launchdarkly/jest/react-native'], |
| 36 | +}; |
| 37 | +``` |
| 38 | + |
| 39 | +## Quickstart |
| 40 | + |
| 41 | +TODO: |
| 42 | + |
| 43 | +## Developing this package |
| 44 | + |
| 45 | +```shell |
| 46 | +# at js-core repo root |
| 47 | +yarn && yarn build && cd packages/tooling/jest |
| 48 | + |
| 49 | +# run tests |
| 50 | +yarn test |
| 51 | +``` |
| 52 | + |
| 53 | +## Verifying SDK build provenance with the SLSA framework |
| 54 | + |
| 55 | +LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md). |
| 56 | + |
| 57 | +## About LaunchDarkly |
| 58 | + |
| 59 | +- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can: |
| 60 | + - Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases. |
| 61 | + - Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?). |
| 62 | + - Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file. |
| 63 | + - Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). |
| 64 | + - Disable parts of your application to facilitate maintenance, without taking everything offline. |
| 65 | +- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list. |
| 66 | +- Explore LaunchDarkly |
| 67 | + - [launchdarkly.com](https://www.launchdarkly.com/ 'LaunchDarkly Main Website') for more information |
| 68 | + - [docs.launchdarkly.com](https://docs.launchdarkly.com/ 'LaunchDarkly Documentation') for our documentation and SDK reference guides |
| 69 | + - [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ 'LaunchDarkly API Documentation') for our API documentation |
| 70 | + - [blog.launchdarkly.com](https://blog.launchdarkly.com/ 'LaunchDarkly Blog Documentation') for the latest product updates |
| 71 | + |
| 72 | +[jest-ci-badge]: https://github.com/launchdarkly/js-core/actions/workflows/jest.yml/badge.svg |
| 73 | +[jest-ci]: https://github.com/launchdarkly/js-core/actions/workflows/jest.yml |
| 74 | +[jest-npm-badge]: https://img.shields.io/npm/v/@launchdarkly/jest.svg?style=flat-square |
| 75 | +[jest-npm-link]: https://www.npmjs.com/package/@launchdarkly/jest |
| 76 | +[jest-ghp-badge]: https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8 |
| 77 | +[jest-ghp-link]: https://launchdarkly.github.io/js-core/packages/tooling/jest/docs/ |
| 78 | +[jest-dm-badge]: https://img.shields.io/npm/dm/@launchdarkly/jest.svg?style=flat-square |
| 79 | +[jest-dt-badge]: https://img.shields.io/npm/dt/@launchdarkly/jest.svg?style=flat-square |
0 commit comments