launchdarkly-js-test-helpers
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

LaunchDarkly JavaScript Test Helpers

Circle CI

This package centralizes some test support code that is used by LaunchDarkly's JavaScript-based SDKs (browser, Node, Electron, etc.) and that may be useful in other JS projects. It can be used to test any kind of JavaScript code as long as the tests themselves are run in Node (version 6 or higher).

While this code may be useful in other projects, it is primarily geared toward LaunchDarkly's own development needs and is not meant to provide a large general-purpose framework. It is meant for unit test code and should not be used as a runtime dependency.

The module is implemented in TypeScript, but can be used without TypeScript. See the API documentation for a description of the functions, parameters, and types in TypeScript syntax.

Usage

In TypeScript or ES6 code:

import { TestHttpServer, promisify } from "launchdarkly-js-test-helpers";

In regular Node.js code:

const { TestHttpServer, promisify } = require("launchdarkly-js-test-helpers");

Build helpers

The scripts directory contains tools that can be helpful in CI; see scripts/README.md.

Contributing

We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.

About LaunchDarkly

  • 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:
    • 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.
    • 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?).
    • 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.
    • 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). Disable parts of your application to facilitate maintenance, without taking everything offline.
  • LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out our documentation for a complete list.
  • Explore LaunchDarkly

Readme

Keywords

Package Sidebar

Install

npm i launchdarkly-js-test-helpers

Weekly Downloads

990

Version

2.2.0

License

Apache-2.0

Unpacked Size

85.4 kB

Total Files

10

Last publish

Collaborators

  • launchdarkly