UNPKG

jest-allure2-reporter

Version:
31 lines 824 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeLabels = normalizeLabels; const SINGLE_LABELS = new Set([ 'owner', 'package', 'parentSuite', 'severity', 'subSuite', 'suite', 'testClass', 'testMethod', 'thread', ]); function normalizeLabels(test) { if (test.labels) { const accumulator = {}; for (const label of test.labels) { if (SINGLE_LABELS.has(label.name)) { accumulator[label.name] = [label]; } else { accumulator[label.name] = accumulator[label.name] || []; accumulator[label.name].push(label); } } return Object.values(accumulator).flat(); } return; } //# sourceMappingURL=normalizeLabels.js.map