Skip to content

createTestPanel

function createTestPanel(options?): TestPanel;

Defined in: testing.ts:38

Create an in-memory FlagsCore with separate source/runtime stores.

Parameter Type
options? { readonly?: boolean; sharedStorage?: boolean; }
options.readonly? boolean
options.sharedStorage? boolean

TestPanel

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