UNPKG

e2ed

Version:

E2E testing framework over Playwright

19 lines (17 loc) 1.07 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const config_1 = require("../utils/config"); const getGlobalErrorHandler_1 = require("../utils/getGlobalErrorHandler"); const tests_1 = require("../utils/tests"); const { testIdleTimeout } = (0, config_1.getFullPackConfig)(); const testIdleTimeoutObject = setInterval(() => process.send?.(null), testIdleTimeout); testIdleTimeoutObject.unref(); process.on('uncaughtException', (0, getGlobalErrorHandler_1.getGlobalErrorHandler)('SubprocessUncaughtException')); process.on('unhandledRejection', (0, getGlobalErrorHandler_1.getGlobalErrorHandler)('SubprocessUnhandledRejection')); /** * Returns exit code `0`, if all tests passed, and `1` otherwise. */ process.on('message', (runRetryOptions) => { void (0, tests_1.runTests)(runRetryOptions).then(() => (0, tests_1.exitFromTestsSubprocess)({ hasError: false, reason: 'run of tests is correctly completed' }), () => (0, tests_1.exitFromTestsSubprocess)({ hasError: true, reason: 'run of tests completed with error' })); });