e2ed
Version:
E2E testing framework over Playwright
23 lines (22 loc) • 845 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTestsThatRunningAtGivenTime = void 0;
/**
* Get tests (test names) that were running at a given UTC time.
* @internal
*/
const getTestsThatRunningAtGivenTime = (utcTimeInMs, liteReport) => {
const namesOfRunningTests = Object.create(null);
const { retries } = liteReport;
for (const retry of retries) {
const { liteTestRuns } = retry;
for (const liteTestRun of liteTestRuns) {
const { endTimeInMs, name, startTimeInMs } = liteTestRun;
if (startTimeInMs <= utcTimeInMs && utcTimeInMs <= endTimeInMs) {
namesOfRunningTests[name] = true;
}
}
}
return Object.keys(namesOfRunningTests);
};
exports.getTestsThatRunningAtGivenTime = getTestsThatRunningAtGivenTime;