# launchdarkly-cypress-plugin

> Skip cypress tests using LaunchDarkly feature flags

Latest version **1.0.1** (published 2025-08-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install launchdarkly-cypress-plugin
pnpm add launchdarkly-cypress-plugin
yarn add launchdarkly-cypress-plugin
bun add launchdarkly-cypress-plugin
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2025-08-13 |
| First published | 2022-03-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | spacelabs |
| Keywords | cypress, cypress-plugin |

## Links

- npm: https://www.npmjs.com/package/launchdarkly-cypress-plugin
- Repository: https://github.com/launchdarkly-labs/launchdarkly-cypress-plugin
- Homepage: https://github.com/launchdarkly-labs/launchdarkly-cypress-plugin#readme
- Issues: https://github.com/launchdarkly-labs/launchdarkly-cypress-plugin/issues
- npm.io page: https://npm.io/package/launchdarkly-cypress-plugin

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^4.3.3
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.2.11
- [@types/mocha](https://npm.io/package/@types/mocha.md) 9.1.0
- [find-test-names](https://npm.io/package/find-test-names.md) ^1.14.1
- [launchdarkly-node-server-sdk](https://npm.io/package/launchdarkly-node-server-sdk.md) ^7.0.3

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2025-08-13
- 1.0.0 — 2023-11-03
- 0.4.1 — 2022-06-08
- 0.4.0 — 2022-06-07
- 0.3.1 — 2022-03-09
- 0.3.0 — 2022-03-09

## README

# LaunchDarkly Cypress Plugin

> Filter cypress tests using LaunchDarkly feature flags

**Required**: You need a LaunchDarkly account to use this plugin. Don't already have one? click [here](https://app.launchdarkly.com) to create one.

## Installation

```bash
$ npm install launchdarkly-cypress-plugin
```

if using yarn run

```bash
$ yarn add launchdarkly-cypress-plugin
```

### Setup

1. Create a [LaunchDarkly feature flag](https://docs.launchdarkly.com/guides/best-practices/creating-flags) with a boolean variation. You can call this flag anything you like. Optionally, you can check the `This is a permanent flag` checkbox.

**Optional** You can also create an environment for your Cypress tests.

2. Go to Account settings -> Projects, search for your environment and copy the SDK key for the environment you will be using.

3. Load and configure the plugin from your cypress [plugin file](https://on.cypress.io/writing-and-organizing-tests#Plugins-file).

**cypress.config.js**

![Plugin Configuration](./images/plugin-setup.png)

Note the `async` keyword on the `setupNodeEvents` function. Cypress will `await` the results of the Promise returned.

4. Register the support configuration in your cypress support file.

**cypress/support/index.js**

![Support Configuration](./images/support-setup.png)

## Skipping your tests

With your flag turned on and returning a default variation of `false`, you can target specific tests or suites using the `suite` or `test` attributes from the `cypress` context kind. Your test suites and test names will be automatically populated in the targeting rule dropdowns for you.

![Flag Configuration](./images/flag-config.png)

When the flag evaluates to true, the matched tests or suites will be skipped by Cypress. See the [Cypress docs](https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Test-statuses) for more details about test statuses.

---
_Source: https://npm.io/package/launchdarkly-cypress-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
