UNPKG

@flopflip/cypress-plugin

Version:

A plugin for Cypress change feature toggles in Cypress runs

22 lines (21 loc) 947 B
//#region src/plugin.ts const FLOPFLIP_GLOBAL = "__flopflip__"; const addCommands = (options) => { Cypress.Commands.add("updateFeatureFlags", (flags) => cy.window().its(FLOPFLIP_GLOBAL).then((flopFlipGlobal) => { const flopflipAdapterGlobal = flopFlipGlobal[options.adapterId]; if (!flopflipAdapterGlobal) throw new Error("@flopflip/cypress: namespace or adapter of the passed id does not exist. Make sure you use one and the specified adapter."); Cypress.log({ name: "updateFeatureFlags", message: "Updating @flopflip feature flags.", consoleProps: () => ({ flags }) }); flopflipAdapterGlobal === null || flopflipAdapterGlobal === void 0 || flopflipAdapterGlobal.updateFlags(flags, { unsubscribeFlags: true }); })); }; const install = (_on) => {}; //#endregion //#region src/index.ts const version = "__@FLOPFLIP/VERSION_OF_RELEASE__"; //#endregion export { addCommands, install, version }; //# sourceMappingURL=index.js.map