UNPKG

cumulocity-cypress

Version:
44 lines (43 loc) 1.4 kB
import { FetchClient } from "@c8y/client"; import { getC8yClientAuthentication } from "../utils"; if (!Cypress.c8ypact) { Cypress.c8ypact = { mode: () => "disabled", recordingMode: () => "refresh", current: null, getCurrentTestId: () => "-", isRecordingEnabled: () => false, isMockingEnabled: () => false, savePact: () => new Promise((resolve) => resolve()), isEnabled: () => false, matcher: undefined, pactRunner: undefined, schemaGenerator: undefined, schemaMatcher: undefined, debugLog: false, preprocessor: undefined, config: {}, getConfigValue: (key, defaultValue) => defaultValue, getConfigValues: () => ({}), loadCurrent: () => cy.wrap(null, { log: false }), env: () => ({}), on: {}, createFetchClient: (auth, baseUrl) => new FetchClient(getC8yClientAuthentication(auth), baseUrl), }; } if (!Cypress.c8yctrl) { Cypress.c8yctrl = { mode: () => "disabled", recordingMode: () => "append", get current() { return null; }, isEnabled: () => false, isRecordingEnabled: () => false, isMockingEnabled: () => false, setCurrent: () => cy.wrap(null), resetCurrent: () => cy.wrap(null), url: () => null, debugLog: false, }; }