createTestPanel
function createTestPanel(options?): TestPanel;Defined in: testing.ts:38
Create an in-memory FlagsCore with separate source/runtime stores.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
{ readonly?: boolean; sharedStorage?: boolean; } |
options.readonly? |
boolean |
options.sharedStorage? |
boolean |
Returns
Section titled “Returns”Example
Section titled “Example”import { createTestPanel, booleanFlag, publishFlags } from "@xtandard/flags/testing";
const { core } = createTestPanel();await publishFlags(core, [booleanFlag("my-feature", { default: true })]);
const [result] = await core.evaluate({ context: { targetingKey: "user-1" }, source: "active",});console.log(result?.value); // true