UNPKG

e2ed

Version:

E2E testing framework over Playwright

33 lines (32 loc) 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setTestStaticOptions = exports.getTestStaticOptions = void 0; const useContext_1 = require("../useContext"); const asserts_1 = require("../utils/asserts"); /** * Raw get and set test static options. * @internal */ const [getRawTestStaticOptions, setRawTestStaticOptions] = (0, useContext_1.useContext)(); /** * Get test static options. * @internal */ const getTestStaticOptions = () => { const testStaticOptions = getRawTestStaticOptions(); (0, asserts_1.assertValueIsDefined)(testStaticOptions, 'testStaticOptions is defined'); return testStaticOptions; }; exports.getTestStaticOptions = getTestStaticOptions; /** * Set test static options. * @internal */ const setTestStaticOptions = (testStaticOptions) => { const currentTestStaticOptions = getRawTestStaticOptions(); (0, asserts_1.assertValueIsUndefined)(currentTestStaticOptions, 'currentTestStaticOptions is not defined', { testStaticOptions, }); setRawTestStaticOptions(testStaticOptions); }; exports.setTestStaticOptions = setTestStaticOptions;