UNPKG

jest-allure2-reporter

Version:
25 lines 784 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ThreadService = void 0; const FREE_SLOT = undefined; class ThreadService { _activeThreads = []; allocateThread(testPath) { let freeIndex = this._activeThreads.indexOf(FREE_SLOT); if (freeIndex === -1) { freeIndex = this._activeThreads.push(testPath); } else { this._activeThreads[freeIndex] = testPath; } return freeIndex; } freeThread(testPath) { const testFileIndex = this._activeThreads.indexOf(testPath); if (testFileIndex !== -1) { this._activeThreads[testFileIndex] = FREE_SLOT; } } } exports.ThreadService = ThreadService; //# sourceMappingURL=ThreadService.js.map