diff --git a/packages/allure-cypress/src/reporter.ts b/packages/allure-cypress/src/reporter.ts index 05cdd00ae..dc7fef993 100644 --- a/packages/allure-cypress/src/reporter.ts +++ b/packages/allure-cypress/src/reporter.ts @@ -2,7 +2,7 @@ import type Cypress from "cypress"; import { readFileSync } from "node:fs"; import { ContentType, LabelName, Stage } from "allure-js-commons"; import { extractMetadataFromString } from "allure-js-commons/sdk"; -import { FileSystemWriter, ReporterRuntime, getSuitesLabels } from "allure-js-commons/sdk/reporter"; +import { FileSystemWriter, ReporterRuntime, getSuiteLabels } from "allure-js-commons/sdk/reporter"; import type { CypressRuntimeMessage, CypressTestEndRuntimeMessage, CypressTestStartRuntimeMessage } from "./model.js"; export type AllureCypressConfig = { @@ -45,7 +45,7 @@ export class AllureCypress { throw new Error("INTERNAL ERROR: Invalid message sequence"); } - const suiteLabels = getSuitesLabels(startMessage.data.specPath.slice(0, -1)); + const suiteLabels = getSuiteLabels(startMessage.data.specPath.slice(0, -1)); const testTitle = startMessage.data.specPath[startMessage.data.specPath.length - 1]; const titleMetadata = extractMetadataFromString(testTitle); const testUuid = this.runtime.startTest({ diff --git a/packages/allure-jest/src/environmentFactory.ts b/packages/allure-jest/src/environmentFactory.ts index 2ebc8b02d..d44159cf7 100644 --- a/packages/allure-jest/src/environmentFactory.ts +++ b/packages/allure-jest/src/environmentFactory.ts @@ -7,7 +7,7 @@ import * as allure from "allure-js-commons"; import { LabelName, Stage, Status } from "allure-js-commons"; import type { RuntimeMessage } from "allure-js-commons/sdk"; import { getMessageAndTraceFromError, getStatusFromError } from "allure-js-commons/sdk"; -import { FileSystemWriter, MessageWriter, ReporterRuntime, getSuitesLabels } from "allure-js-commons/sdk/reporter"; +import { FileSystemWriter, MessageWriter, ReporterRuntime, getSuiteLabels } from "allure-js-commons/sdk/reporter"; import { setGlobalTestRuntime } from "allure-js-commons/sdk/runtime"; import { AllureJestTestRuntime } from "./AllureJestTestRuntime.js"; import type { AllureJestConfig, AllureJestEnvironment } from "./model.js"; @@ -159,7 +159,7 @@ const createJestEnvironment = (Base: T): T => result.labels.push({ name: LabelName.HOST, value: hostLabel }); } - result.labels.push(...getSuitesLabels(newTestSuitesPath)); + result.labels.push(...getSuiteLabels(newTestSuitesPath)); }, testUuid); /** diff --git a/packages/allure-js-commons/src/sdk/reporter/utils.ts b/packages/allure-js-commons/src/sdk/reporter/utils.ts index 380656359..987d97fd9 100644 --- a/packages/allure-js-commons/src/sdk/reporter/utils.ts +++ b/packages/allure-js-commons/src/sdk/reporter/utils.ts @@ -227,8 +227,6 @@ export const getSuiteLabels = (suites: readonly string[]): Label[] => { return labels; }; -export const getSuitesLabels = getSuiteLabels; - const suiteLabelNames: readonly string[] = [LabelName.PARENT_SUITE, LabelName.SUITE, LabelName.SUB_SUITE]; export const ensureSuiteLabels = (test: Partial, defaultSuites: readonly string[]) => { diff --git a/packages/allure-js-commons/test/sdk/reporter/utils.spec.ts b/packages/allure-js-commons/test/sdk/reporter/utils.spec.ts index a60e82839..e1e2c0f12 100644 --- a/packages/allure-js-commons/test/sdk/reporter/utils.spec.ts +++ b/packages/allure-js-commons/test/sdk/reporter/utils.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; import { LabelName } from "../../../src/model.js"; -import { getSuitesLabels, serialize, typeToExtension } from "../../../src/sdk/reporter/utils.js"; +import { getSuiteLabels, serialize, typeToExtension } from "../../../src/sdk/reporter/utils.js"; describe("typeToExtension", () => { it("should respect provided file extension", () => { @@ -46,16 +46,16 @@ describe("typeToExtension", () => { }); }); -describe("getSuitesLabels", () => { +describe("getSuiteLabels", () => { describe("with empty suites", () => { it("returns empty array", () => { - expect(getSuitesLabels([])).toEqual([]); + expect(getSuiteLabels([])).toEqual([]); }); }); describe("with single suite", () => { it("returns parent suite label as the first element", () => { - expect(getSuitesLabels(["foo"])).toEqual([ + expect(getSuiteLabels(["foo"])).toEqual([ { name: LabelName.PARENT_SUITE, value: "foo", @@ -66,7 +66,7 @@ describe("getSuitesLabels", () => { describe("with two suites", () => { it("returns parent suite and suite labels as the first two elements", () => { - expect(getSuitesLabels(["foo", "bar"])).toEqual([ + expect(getSuiteLabels(["foo", "bar"])).toEqual([ { name: LabelName.PARENT_SUITE, value: "foo", @@ -81,7 +81,7 @@ describe("getSuitesLabels", () => { describe("with three or more suites", () => { it("returns list of three elements where last one is a sub suite label", () => { - expect(getSuitesLabels(["foo", "bar", "baz", "beep", "boop"])).toEqual([ + expect(getSuiteLabels(["foo", "bar", "baz", "beep", "boop"])).toEqual([ { name: LabelName.PARENT_SUITE, value: "foo", diff --git a/packages/allure-vitest/src/reporter.ts b/packages/allure-vitest/src/reporter.ts index cb46f859c..84b725c26 100644 --- a/packages/allure-vitest/src/reporter.ts +++ b/packages/allure-vitest/src/reporter.ts @@ -12,7 +12,7 @@ import { ReporterRuntime, getEnvironmentLabels, getHostLabel, - getSuitesLabels, + getSuiteLabels, getThreadLabel, } from "allure-js-commons/sdk/reporter"; import { getSuitePath, getTestFullName } from "./utils.js"; @@ -107,7 +107,7 @@ export default class AllureVitestReporter implements Reporter { value: "javascript", }); result.labels.push(...titleMetadata.labels); - result.labels.push(...getSuitesLabels(suitePath)); + result.labels.push(...getSuiteLabels(suitePath)); result.labels.push(...getEnvironmentLabels()); result.labels.push(getHostLabel()); result.labels.push(getThreadLabel(VITEST_POOL_ID && `vitest-worker-${VITEST_POOL_ID}`));