UNPKG

e2ed

Version:

E2E testing framework over Playwright

24 lines (23 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.processAllRequestsCompletePredicates = void 0; const processAllRequestsCompletePredicate_1 = require("./processAllRequestsCompletePredicate"); /** * Processes `waitForAllRequestsComplete` predicates for new request. * @internal */ const processAllRequestsCompletePredicates = async (requestHookContextId, waitForEventsState) => { const { allRequestsCompletePredicates, hashOfNotCompleteRequests } = waitForEventsState; const request = hashOfNotCompleteRequests[requestHookContextId]; if (request === undefined) { return; } const promises = [...allRequestsCompletePredicates].map(async (allRequestsCompletePredicateWithPromise) => { const isFulfilled = await (0, processAllRequestsCompletePredicate_1.processAllRequestsCompletePredicate)(allRequestsCompletePredicateWithPromise, request, requestHookContextId); if (isFulfilled) { allRequestsCompletePredicates.delete(allRequestsCompletePredicateWithPromise); } }); await Promise.all(promises); }; exports.processAllRequestsCompletePredicates = processAllRequestsCompletePredicates;