e2ed
Version:
E2E testing framework over Playwright
29 lines (27 loc) • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const configurator_1 = require("../configurator");
const asserts_1 = require("../utils/asserts");
const end_1 = require("../utils/end");
const environment_1 = require("../utils/environment");
const events_1 = require("../utils/events");
const generalLog_1 = require("../utils/generalLog");
const getGlobalErrorHandler_1 = require("../utils/getGlobalErrorHandler");
const pack_1 = require("../utils/pack");
const uiMode_1 = require("../utils/uiMode");
const uiFlagIndex = process.argv.indexOf('--ui');
if (uiFlagIndex !== -1) {
(0, uiMode_1.setUiMode)();
process.argv.splice(uiFlagIndex, 1);
}
const [pathToPack] = process.argv.splice(2, 1);
(0, asserts_1.assertValueIsDefined)(pathToPack, 'pathToPack is defined', { argv: process.argv });
process.on('uncaughtException', (0, getGlobalErrorHandler_1.getGlobalErrorHandler)('E2edUncaughtException'));
process.on('unhandledRejection', (0, getGlobalErrorHandler_1.getGlobalErrorHandler)('E2edUnhandledRejection'));
(0, environment_1.setPathToPack)(pathToPack);
(0, end_1.setProcessEndHandlers)();
(0, configurator_1.setRunEnvironment)("local" /* RunEnvironment.Local */);
const e2edRunPromise = (0, events_1.registerStartE2edRunEvent)().then(pack_1.runPackWithArgs).catch(generalLog_1.logStartE2edError);
// eslint-disable-next-line @typescript-eslint/no-misused-promises
void e2edRunPromise.finally(events_1.registerEndE2edRunEvent);