From b8dd06dbfeb6f93b38869348ab16ded9d1545348 Mon Sep 17 00:00:00 2001 From: Maksim Stepanov <17935127+delatrie@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:45:24 +0700 Subject: [PATCH] Move test plan index type to types.ts --- packages/allure-mocha/src/AllureMochaReporter.ts | 2 +- packages/allure-mocha/src/types.ts | 5 +++++ packages/allure-mocha/src/utils.ts | 7 +------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/allure-mocha/src/AllureMochaReporter.ts b/packages/allure-mocha/src/AllureMochaReporter.ts index 9d5217617..0f823ec61 100644 --- a/packages/allure-mocha/src/AllureMochaReporter.ts +++ b/packages/allure-mocha/src/AllureMochaReporter.ts @@ -15,6 +15,7 @@ import { import { setGlobalTestRuntime } from "allure-js-commons/sdk/runtime"; import { MochaTestRuntime } from "./MochaTestRuntime.js"; import { setLegacyApiRuntime } from "./legacyUtils.js"; +import type { TestPlanIndices } from "./types.js"; import { applyTestPlan, createTestPlanIndices, @@ -30,7 +31,6 @@ import { resolveParallelModeSetupFile, setTestScope, } from "./utils.js"; -import type { TestPlanIndices } from "./utils.js"; const { EVENT_SUITE_BEGIN, diff --git a/packages/allure-mocha/src/types.ts b/packages/allure-mocha/src/types.ts index 8bce3cd43..34d13e467 100644 --- a/packages/allure-mocha/src/types.ts +++ b/packages/allure-mocha/src/types.ts @@ -1,5 +1,10 @@ import type { Label } from "allure-js-commons"; +export type TestPlanIndices = { + fullNameIndex: ReadonlySet; + idIndex: ReadonlySet; +}; + export type AllureMochaTestData = { isIncludedInTestRun: boolean; fullName: string; diff --git a/packages/allure-mocha/src/utils.ts b/packages/allure-mocha/src/utils.ts index 0ac2fd9d2..b09059469 100644 --- a/packages/allure-mocha/src/utils.ts +++ b/packages/allure-mocha/src/utils.ts @@ -7,7 +7,7 @@ import { LabelName } from "allure-js-commons"; import type { TestPlanV1, TestPlanV1Test } from "allure-js-commons/sdk"; import { extractMetadataFromString } from "allure-js-commons/sdk"; import { getHostLabel, getRelativePath, getThreadLabel, md5, parseTestPlan } from "allure-js-commons/sdk/reporter"; -import type { AllureMochaTestData, HookCategory, HookScope, HookType } from "./types.js"; +import type { AllureMochaTestData, HookCategory, HookScope, HookType, TestPlanIndices } from "./types.js"; const filename = fileURLToPath(import.meta.url); @@ -41,11 +41,6 @@ const createTestPlanIdIndex = (testplan: TestPlanV1) => createTestPlanIndex((e) const createTestPlanIndex = (keySelector: (entry: TestPlanV1Test) => T | undefined, testplan: TestPlanV1): Set => new Set(testplan.tests.map((e) => keySelector(e)).filter((v) => v)) as Set; -export type TestPlanIndices = { - fullNameIndex: ReadonlySet; - idIndex: ReadonlySet; -}; - export const createTestPlanIndices = (): TestPlanIndices | undefined => { const testplan = parseTestPlan(); if (testplan) {