diff --git a/packages/allure-codeceptjs/rollup.config.mjs b/packages/allure-codeceptjs/rollup.config.mjs index 5bd991eab..6addd094b 100644 --- a/packages/allure-codeceptjs/rollup.config.mjs +++ b/packages/allure-codeceptjs/rollup.config.mjs @@ -9,7 +9,11 @@ const dirname = fileURLToPath(new URL(".", import.meta.url)); const createNodeEntry = (inputFile) => { const outputFileBase = inputFile.replace(/^src/, "dist"); const external = [ - + "allure-js-commons", + "allure-js-commons/sdk/node", + "strip-ansi", + "codeceptjs", + "node:path", ]; return [ diff --git a/packages/allure-codeceptjs/src/index.ts b/packages/allure-codeceptjs/src/index.ts index 40bc2edbb..8a8f5c684 100644 --- a/packages/allure-codeceptjs/src/index.ts +++ b/packages/allure-codeceptjs/src/index.ts @@ -18,7 +18,7 @@ import { TestRuntime, extractMetadataFromString, setGlobalTestRuntime, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { extractMeta } from "./helpers"; import { CodeceptError, CodeceptHook, CodeceptStep, CodeceptTest } from "./model"; import { AllureCodeceptJSConfig } from "./model.js"; diff --git a/packages/allure-codeceptjs/src/model.ts b/packages/allure-codeceptjs/src/model.ts index 55f0c8d9c..4b1472f21 100644 --- a/packages/allure-codeceptjs/src/model.ts +++ b/packages/allure-codeceptjs/src/model.ts @@ -1,4 +1,4 @@ -import type { Config } from "allure-js-commons/new/sdk/browser"; +import type { Config } from "allure-js-commons/sdk/browser"; export interface CodeceptError { params: any; diff --git a/packages/allure-codeceptjs/test/spec/attachments.test.ts b/packages/allure-codeceptjs/test/spec/attachments.test.ts index c2ec4dccc..cde53c411 100644 --- a/packages/allure-codeceptjs/test/spec/attachments.test.ts +++ b/packages/allure-codeceptjs/test/spec/attachments.test.ts @@ -4,7 +4,7 @@ import { runCodeceptJSInlineTest } from "../utils"; it("handles attachments in tests", async () => { const { tests, attachments } = await runCodeceptJSInlineTest({ "login.test.js": ` - const { attachment } = require("allure-js-commons/new"); + const { attachment } = require("allure-js-commons"); Feature("sample-feature"); Scenario("sample-scenario", async () => { @@ -30,7 +30,7 @@ it("handles attachments in tests", async () => { it("handles attachments in runtime steps", async () => { const { tests, attachments } = await runCodeceptJSInlineTest({ "login.test.js": ` - const { step, attachment } = require("allure-js-commons/new"); + const { step, attachment } = require("allure-js-commons"); Feature("sample-feature"); Scenario("sample-scenario", async () => { diff --git a/packages/allure-codeceptjs/test/spec/hooks.test.ts b/packages/allure-codeceptjs/test/spec/hooks.test.ts index 615853d85..e48142f2a 100644 --- a/packages/allure-codeceptjs/test/spec/hooks.test.ts +++ b/packages/allure-codeceptjs/test/spec/hooks.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Stage, Status } from "allure-js-commons/new/sdk/node"; +import { Stage, Status } from "allure-js-commons/sdk/node"; import { runCodeceptJSInlineTest } from "../utils"; it("handles hooks", async () => { diff --git a/packages/allure-codeceptjs/test/spec/labels.test.ts b/packages/allure-codeceptjs/test/spec/labels.test.ts index 2156b6c10..599b68063 100644 --- a/packages/allure-codeceptjs/test/spec/labels.test.ts +++ b/packages/allure-codeceptjs/test/spec/labels.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk/node"; +import { LabelName } from "allure-js-commons/sdk/node"; import { runCodeceptJSInlineTest } from "../utils"; it("adds labels", async () => { @@ -19,7 +19,7 @@ it("adds labels", async () => { severity, story, tag, - } = require("allure-js-commons/new"); + } = require("allure-js-commons"); Feature("login-feature"); Scenario("login-scenario1", async () => { diff --git a/packages/allure-codeceptjs/test/spec/links.test.ts b/packages/allure-codeceptjs/test/spec/links.test.ts index 2a99f32da..5560dbf89 100644 --- a/packages/allure-codeceptjs/test/spec/links.test.ts +++ b/packages/allure-codeceptjs/test/spec/links.test.ts @@ -1,11 +1,11 @@ import { expect, it } from "vitest"; -import { LinkType } from "allure-js-commons/new/sdk/node"; +import { LinkType } from "allure-js-commons/sdk/node"; import { runCodeceptJSInlineTest } from "../utils"; it("sets runtime links", async () => { const results = await runCodeceptJSInlineTest({ "sample.test.js": ` - const { link, links, issue, tms } = require('allure-js-commons/new'); + const { link, links, issue, tms } = require('allure-js-commons'); Feature("login-feature"); Scenario("login-scenario1", async () => { diff --git a/packages/allure-codeceptjs/test/spec/parameters.test.ts b/packages/allure-codeceptjs/test/spec/parameters.test.ts index 94aba505f..9fe41918c 100644 --- a/packages/allure-codeceptjs/test/spec/parameters.test.ts +++ b/packages/allure-codeceptjs/test/spec/parameters.test.ts @@ -4,7 +4,7 @@ import { runCodeceptJSInlineTest } from "../utils"; it("sets parameters", async () => { const { tests } = await runCodeceptJSInlineTest({ "sample.test.js": ` - const { parameter } = require("allure-js-commons/new"); + const { parameter } = require("allure-js-commons"); Feature("login-feature"); Scenario("login-scenario1", async () => { diff --git a/packages/allure-codeceptjs/test/spec/simple.test.ts b/packages/allure-codeceptjs/test/spec/simple.test.ts index 63c5f281e..87f8ae823 100644 --- a/packages/allure-codeceptjs/test/spec/simple.test.ts +++ b/packages/allure-codeceptjs/test/spec/simple.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Stage, Status } from "allure-js-commons/new/sdk/node"; +import { Stage, Status } from "allure-js-commons/sdk/node"; import { runCodeceptJSInlineTest } from "../utils"; it("simple scenarios", async () => { diff --git a/packages/allure-codeceptjs/test/spec/steps.test.ts b/packages/allure-codeceptjs/test/spec/steps.test.ts index a0fed07fe..0a9523196 100644 --- a/packages/allure-codeceptjs/test/spec/steps.test.ts +++ b/packages/allure-codeceptjs/test/spec/steps.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Stage, Status } from "allure-js-commons/new/sdk/node"; +import { Stage, Status } from "allure-js-commons/sdk/node"; import { runCodeceptJSInlineTest } from "../utils"; it("handles codeceptjs steps", async () => { @@ -43,7 +43,7 @@ it("handles codeceptjs steps", async () => { it("handles lambda steps", async () => { const { tests } = await runCodeceptJSInlineTest({ "sample.test.js": ` - const { step } = require("allure-js-commons/new"); + const { step } = require("allure-js-commons"); Feature("sample-feature-1"); Scenario("scenario1", async ({ I }) => { diff --git a/packages/allure-codeceptjs/test/spec/tags.test.ts b/packages/allure-codeceptjs/test/spec/tags.test.ts index 8f038b601..6d226bfa8 100644 --- a/packages/allure-codeceptjs/test/spec/tags.test.ts +++ b/packages/allure-codeceptjs/test/spec/tags.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk/node"; +import { LabelName } from "allure-js-commons/sdk/node"; import { runCodeceptJSInlineTest } from "../utils"; it("supports codecept tags", async () => { diff --git a/packages/allure-codeceptjs/test/spec/titleMetadata.test.ts b/packages/allure-codeceptjs/test/spec/titleMetadata.test.ts index dfd8489b3..53dd16677 100644 --- a/packages/allure-codeceptjs/test/spec/titleMetadata.test.ts +++ b/packages/allure-codeceptjs/test/spec/titleMetadata.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk/node"; +import { LabelName } from "allure-js-commons/sdk/node"; import { runCodeceptJSInlineTest } from "../utils"; it("handles title metadata", async () => { diff --git a/packages/allure-codeceptjs/test/utils.ts b/packages/allure-codeceptjs/test/utils.ts index 7beb27cdb..eb29e2b56 100644 --- a/packages/allure-codeceptjs/test/utils.ts +++ b/packages/allure-codeceptjs/test/utils.ts @@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto"; import { mkdir, readFile, rm, writeFile } from "node:fs/promises"; import { join } from "node:path"; import { dirname, resolve as resolvePath } from "node:path"; -import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons/new/sdk/node"; +import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons/sdk/node"; const parseJsonResult = (data: string) => { return JSON.parse(Buffer.from(data, "base64").toString("utf8")) as T; diff --git a/packages/allure-cucumberjs/rollup.config.mjs b/packages/allure-cucumberjs/rollup.config.mjs index 1980ee89a..8550ee8cc 100644 --- a/packages/allure-cucumberjs/rollup.config.mjs +++ b/packages/allure-cucumberjs/rollup.config.mjs @@ -15,8 +15,8 @@ const createNodeEntry = (inputFile) => { "node:os", "node:fs", "node:process", - "allure-js-commons/new/sdk/node", - "allure-js-commons/new/internal", + "allure-js-commons/sdk/node", + "allure-js-commons/internal", ]; return [ diff --git a/packages/allure-cucumberjs/src/index.ts b/packages/allure-cucumberjs/src/index.ts index a890fd663..7fc2fbb5f 100644 --- a/packages/allure-cucumberjs/src/index.ts +++ b/packages/allure-cucumberjs/src/index.ts @@ -1,5 +1,5 @@ import { Before, World } from "@cucumber/cucumber"; -import { ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from "allure-js-commons/new/internal"; +import { ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from "allure-js-commons/internal"; import { ContentType, Label, @@ -14,7 +14,7 @@ import { TestRuntime, getStatusFromError, setGlobalTestRuntime, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; export class AllureCucumberTestRuntime extends World implements TestRuntime { messagesHolder = new MessagesHolder(); diff --git a/packages/allure-cucumberjs/src/model.ts b/packages/allure-cucumberjs/src/model.ts index 18089848d..3baf22f43 100644 --- a/packages/allure-cucumberjs/src/model.ts +++ b/packages/allure-cucumberjs/src/model.ts @@ -1,4 +1,4 @@ -import { Config, LabelName, LinkType } from "allure-js-commons/new/sdk/node"; +import { Config, LabelName, LinkType } from "allure-js-commons/sdk/node"; export type LabelConfig = { pattern: RegExp[]; diff --git a/packages/allure-cucumberjs/src/reporter.ts b/packages/allure-cucumberjs/src/reporter.ts index c0b11b843..3fb8cb313 100644 --- a/packages/allure-cucumberjs/src/reporter.ts +++ b/packages/allure-cucumberjs/src/reporter.ts @@ -3,7 +3,7 @@ import * as messages from "@cucumber/messages"; import { PickleTag, Tag, TestStepResult, TestStepResultStatus } from "@cucumber/messages"; import os from "node:os"; import process from "node:process"; -import { ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from "allure-js-commons/new/internal"; +import { ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from "allure-js-commons/internal"; import { AllureNodeReporterRuntime, Config, @@ -18,7 +18,7 @@ import { TestResult, createStepResult, getWorstStepResultStatus, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { AllureCucumberReporterConfig, LabelConfig, LinkConfig } from "./model"; const { ALLURE_THREAD_NAME } = process.env; diff --git a/packages/allure-cucumberjs/test/fixtures/features/dataTableAndExamples.feature b/packages/allure-cucumberjs/test/fixtures/features/dataTableAndExamples.feature index 998020884..03b64861a 100644 --- a/packages/allure-cucumberjs/test/fixtures/features/dataTableAndExamples.feature +++ b/packages/allure-cucumberjs/test/fixtures/features/dataTableAndExamples.feature @@ -7,6 +7,6 @@ Feature: dataTableAndExamples When I add to Then result is - Examples: + Examples: | b | result | | 3 | 4 | diff --git a/packages/allure-cucumberjs/test/fixtures/features/examples.feature b/packages/allure-cucumberjs/test/fixtures/features/examples.feature index b45678d3d..babbdac5b 100644 --- a/packages/allure-cucumberjs/test/fixtures/features/examples.feature +++ b/packages/allure-cucumberjs/test/fixtures/features/examples.feature @@ -6,7 +6,7 @@ Feature: Test Scenarios with Examples When I add a to b Then result is - Examples: + Examples: | a | b | result | | 1 | 3 | 4 | | 2 | 4 | 6 | diff --git a/packages/allure-cucumberjs/test/fixtures/support/attachments.cjs b/packages/allure-cucumberjs/test/fixtures/support/attachments.cjs index 6e8d0c1c1..8d0545d87 100644 --- a/packages/allure-cucumberjs/test/fixtures/support/attachments.cjs +++ b/packages/allure-cucumberjs/test/fixtures/support/attachments.cjs @@ -1,5 +1,5 @@ const { Given } = require("@cucumber/cucumber"); -const { attachment } = require("allure-js-commons/new"); +const { attachment } = require("allure-js-commons"); Given("add a text", async () => { await attachment("Text attachment", "some text", "text/plain"); diff --git a/packages/allure-cucumberjs/test/fixtures/support/description.cjs b/packages/allure-cucumberjs/test/fixtures/support/description.cjs index 4bd005304..fe902196b 100644 --- a/packages/allure-cucumberjs/test/fixtures/support/description.cjs +++ b/packages/allure-cucumberjs/test/fixtures/support/description.cjs @@ -1,5 +1,5 @@ const { Given } = require("@cucumber/cucumber"); -const { description, descriptionHtml } = require("allure-js-commons/new"); +const { description, descriptionHtml } = require("allure-js-commons"); Given("a step", () => {}); diff --git a/packages/allure-cucumberjs/test/fixtures/support/labels.cjs b/packages/allure-cucumberjs/test/fixtures/support/labels.cjs index a77fc2956..08ad3d65f 100644 --- a/packages/allure-cucumberjs/test/fixtures/support/labels.cjs +++ b/packages/allure-cucumberjs/test/fixtures/support/labels.cjs @@ -12,7 +12,7 @@ const { severity, story, tag, -} = require("allure-js-commons/new"); +} = require("allure-js-commons"); Given("a step", () => {}); diff --git a/packages/allure-cucumberjs/test/fixtures/support/links.cjs b/packages/allure-cucumberjs/test/fixtures/support/links.cjs index 90e955edc..ddfb50215 100644 --- a/packages/allure-cucumberjs/test/fixtures/support/links.cjs +++ b/packages/allure-cucumberjs/test/fixtures/support/links.cjs @@ -1,5 +1,5 @@ const { Given } = require("@cucumber/cucumber"); -const { link, issue, tms } = require("allure-js-commons/new"); +const { link, issue, tms } = require("allure-js-commons"); Given("a step", () => {}); diff --git a/packages/allure-cucumberjs/test/fixtures/support/steps.cjs b/packages/allure-cucumberjs/test/fixtures/support/steps.cjs index 5c0c57cca..44a1ec16e 100644 --- a/packages/allure-cucumberjs/test/fixtures/support/steps.cjs +++ b/packages/allure-cucumberjs/test/fixtures/support/steps.cjs @@ -1,5 +1,5 @@ const { Given } = require("@cucumber/cucumber"); -const { step, label, epic, attachment } = require("allure-js-commons/new"); +const { step, label, epic, attachment } = require("allure-js-commons"); Given("allows to define runtime step", async () => { await step("first nested step", async function () { diff --git a/packages/allure-cucumberjs/test/spec/dataTable.test.ts b/packages/allure-cucumberjs/test/spec/dataTable.test.ts index cdf101316..b4b9b91d6 100644 --- a/packages/allure-cucumberjs/test/spec/dataTable.test.ts +++ b/packages/allure-cucumberjs/test/spec/dataTable.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { ContentType } from "allure-js-commons/new/sdk"; +import { ContentType } from "allure-js-commons/sdk"; import { runCucumberInlineTest } from "../utils"; it("handles data tables", async () => { diff --git a/packages/allure-cucumberjs/test/spec/dataTableAndExamples.test.ts b/packages/allure-cucumberjs/test/spec/dataTableAndExamples.test.ts index 100840ac9..a22c13865 100644 --- a/packages/allure-cucumberjs/test/spec/dataTableAndExamples.test.ts +++ b/packages/allure-cucumberjs/test/spec/dataTableAndExamples.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { ContentType } from "allure-js-commons/new/sdk"; +import { ContentType } from "allure-js-commons/sdk"; import { runCucumberInlineTest } from "../utils"; it("handles both data table and examples for one feature", async () => { diff --git a/packages/allure-cucumberjs/test/spec/examples.test.ts b/packages/allure-cucumberjs/test/spec/examples.test.ts index 27f1385e7..942d01613 100644 --- a/packages/allure-cucumberjs/test/spec/examples.test.ts +++ b/packages/allure-cucumberjs/test/spec/examples.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { ContentType } from "allure-js-commons/new/sdk"; +import { ContentType } from "allure-js-commons/sdk"; import { runCucumberInlineTest } from "../utils"; it("handles examples table", async () => { diff --git a/packages/allure-cucumberjs/test/spec/labels.test.ts b/packages/allure-cucumberjs/test/spec/labels.test.ts index 1c181c0a7..f69c005d8 100644 --- a/packages/allure-cucumberjs/test/spec/labels.test.ts +++ b/packages/allure-cucumberjs/test/spec/labels.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk"; +import { LabelName } from "allure-js-commons/sdk"; import { runCucumberInlineTest } from "../utils"; it("handles runtime labels", async () => { diff --git a/packages/allure-cucumberjs/test/spec/links.test.ts b/packages/allure-cucumberjs/test/spec/links.test.ts index d0a4fa647..981e98bfd 100644 --- a/packages/allure-cucumberjs/test/spec/links.test.ts +++ b/packages/allure-cucumberjs/test/spec/links.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LinkType } from "allure-js-commons/new/sdk"; +import { LinkType } from "allure-js-commons/sdk"; import { runCucumberInlineTest } from "../utils"; it("handles runtime links", async () => { diff --git a/packages/allure-cucumberjs/test/spec/simple.test.ts b/packages/allure-cucumberjs/test/spec/simple.test.ts index 4c106cb90..85611e40a 100644 --- a/packages/allure-cucumberjs/test/spec/simple.test.ts +++ b/packages/allure-cucumberjs/test/spec/simple.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Stage, Status } from "allure-js-commons/new/sdk"; +import { Stage, Status } from "allure-js-commons/sdk"; import { runCucumberInlineTest } from "../utils"; it("handles basic cases", async () => { diff --git a/packages/allure-cucumberjs/test/spec/steps.test.ts b/packages/allure-cucumberjs/test/spec/steps.test.ts index 8214602ab..b0c214872 100644 --- a/packages/allure-cucumberjs/test/spec/steps.test.ts +++ b/packages/allure-cucumberjs/test/spec/steps.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LabelName, Stage, Status } from "allure-js-commons/new/sdk/node"; +import { LabelName, Stage, Status } from "allure-js-commons/sdk/node"; import { runCucumberInlineTest } from "../utils"; it("handles runtime steps", async () => { diff --git a/packages/allure-cucumberjs/test/spec/tags.test.ts b/packages/allure-cucumberjs/test/spec/tags.test.ts index 485cd1413..32316f7cc 100644 --- a/packages/allure-cucumberjs/test/spec/tags.test.ts +++ b/packages/allure-cucumberjs/test/spec/tags.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk"; +import { LabelName } from "allure-js-commons/sdk"; import { runCucumberInlineTest } from "../utils"; it("assigns unmatched tags as tags labels", async () => { diff --git a/packages/allure-cucumberjs/test/spec/undefinedStepDefs.test.ts b/packages/allure-cucumberjs/test/spec/undefinedStepDefs.test.ts index a023065b9..f9293abd8 100644 --- a/packages/allure-cucumberjs/test/spec/undefinedStepDefs.test.ts +++ b/packages/allure-cucumberjs/test/spec/undefinedStepDefs.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Stage, Status } from "allure-js-commons/new/sdk"; +import { Stage, Status } from "allure-js-commons/sdk"; import { runCucumberInlineTest } from "../utils"; it("reports undefined tests and steps", async () => { diff --git a/packages/allure-cucumberjs/test/utils.ts b/packages/allure-cucumberjs/test/utils.ts index 5fa1092bf..ae8054d54 100644 --- a/packages/allure-cucumberjs/test/utils.ts +++ b/packages/allure-cucumberjs/test/utils.ts @@ -2,7 +2,7 @@ import { fork } from "node:child_process"; import { randomUUID } from "node:crypto"; import { copyFile, mkdir, rm, writeFile } from "node:fs/promises"; import { join, resolve as resolvePath } from "node:path"; -import { AllureResults, TestResult, TestResultContainer } from "allure-js-commons/new/sdk"; +import { AllureResults, TestResult, TestResultContainer } from "allure-js-commons/sdk"; export const runCucumberInlineTest = async (features: string[], stepsDefs: string[]): Promise => { const res: AllureResults = { diff --git a/packages/allure-cypress/rollup.config.mjs b/packages/allure-cypress/rollup.config.mjs index dd0fa06da..0cebb758d 100644 --- a/packages/allure-cypress/rollup.config.mjs +++ b/packages/allure-cypress/rollup.config.mjs @@ -10,7 +10,7 @@ const dirname = fileURLToPath(new URL(".", import.meta.url)); const createNodeEntry = (inputFile) => { const outputFileBase = inputFile.replace(/^src/, "dist"); - const external = ["node:fs", "allure-js-commons/new/sdk/node"]; + const external = ["node:fs", "allure-js-commons/sdk/node"]; return [ defineConfig({ diff --git a/packages/allure-cypress/src/index.ts b/packages/allure-cypress/src/index.ts index 450fe1bad..f5eb8e513 100644 --- a/packages/allure-cypress/src/index.ts +++ b/packages/allure-cypress/src/index.ts @@ -14,7 +14,7 @@ import { getUnfinishedStepsMessages, hasStepMessage, setGlobalTestRuntime, -} from "allure-js-commons/new/sdk/browser"; +} from "allure-js-commons/sdk/browser"; import { CypressRuntimeMessage } from "./model.js"; import { normalizeAttachmentContentEncoding, uint8ArrayToBase64 } from "./utils.js"; diff --git a/packages/allure-cypress/src/model.ts b/packages/allure-cypress/src/model.ts index a1c7b6ff9..2ec75b040 100644 --- a/packages/allure-cypress/src/model.ts +++ b/packages/allure-cypress/src/model.ts @@ -1,4 +1,4 @@ -import { RuntimeMessage, Stage, Status, StatusDetails } from "allure-js-commons/new/sdk"; +import { RuntimeMessage, Stage, Status, StatusDetails } from "allure-js-commons/sdk"; export type CypressTestStartRuntimeMessage = { type: "cypress_start"; diff --git a/packages/allure-cypress/src/reporter.ts b/packages/allure-cypress/src/reporter.ts index c94c1e9a9..70f055ab5 100644 --- a/packages/allure-cypress/src/reporter.ts +++ b/packages/allure-cypress/src/reporter.ts @@ -8,7 +8,7 @@ import { Stage, extractMetadataFromString, getSuitesLabels, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { CypressRuntimeMessage, CypressTestEndRuntimeMessage, CypressTestStartRuntimeMessage } from "./model.js"; export type AllureCypressConfig = { diff --git a/packages/allure-cypress/test/spec/screenshots.test.ts b/packages/allure-cypress/test/spec/screenshots.test.ts index 553696d10..60aada48a 100644 --- a/packages/allure-cypress/test/spec/screenshots.test.ts +++ b/packages/allure-cypress/test/spec/screenshots.test.ts @@ -18,7 +18,7 @@ it("attaches screenshots for failed specs", async () => { expect(attachment.name).toBe("Screenshot"); expect(attachment.type).toBe(ContentType.PNG); - expect(attachments).toHaveProperty(attachment.source as string); + expect(attachments).toHaveProperty(attachment.source); }); it("attaches runtime screenshots", async () => { @@ -37,5 +37,5 @@ it("attaches runtime screenshots", async () => { expect(attachment.name).toBe("foo"); expect(attachment.type).toBe(ContentType.PNG); - expect(attachments).toHaveProperty(attachment.source as string); + expect(attachments).toHaveProperty(attachment.source); }); diff --git a/packages/allure-cypress/test/spec/video.test.ts b/packages/allure-cypress/test/spec/video.test.ts index 458f63d4a..082b02136 100644 --- a/packages/allure-cypress/test/spec/video.test.ts +++ b/packages/allure-cypress/test/spec/video.test.ts @@ -50,5 +50,5 @@ it("attaches same video to each spec in a test", async () => { expect(attachment.name).toBe("Video"); expect(attachment.type).toBe(ContentType.MP4); expect(tests[1].attachments).toContainEqual(attachment); - expect(attachments).toHaveProperty(attachment.source as string); + expect(attachments).toHaveProperty(attachment.source); }); diff --git a/packages/allure-cypress/test/utils.ts b/packages/allure-cypress/test/utils.ts index 0f179e9a4..d7f59760a 100644 --- a/packages/allure-cypress/test/utils.ts +++ b/packages/allure-cypress/test/utils.ts @@ -2,7 +2,7 @@ import { fork } from "node:child_process"; import { randomUUID } from "node:crypto"; import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises"; import { join, resolve as resolvePath } from "node:path"; -import type { AllureResults } from "allure-js-commons/new"; +import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons"; export const runCypressInlineTest = async ( test: (allureCommonsModulePath: string) => string, @@ -55,7 +55,7 @@ export const runCypressInlineTest = async ( const supportContent = ` import "allure-cypress"; `; - const allureJsCommonsPath = require.resolve("allure-js-commons/new"); + const allureJsCommonsPath = require.resolve("allure-js-commons"); await mkdir(cypressTestsDir, { recursive: true }); await mkdir(cypressSupportDir, { recursive: true }); @@ -97,12 +97,12 @@ export const runCypressInlineTest = async ( } if (/-container\.json$/.test(resultFile)) { - res.groups.push(JSON.parse(await readFile(join(testResultsDir, resultFile), "utf8"))); + res.groups.push(JSON.parse(await readFile(join(testResultsDir, resultFile), "utf8")) as TestResultContainer); continue; } if (/-result\.json$/.test(resultFile)) { - res.tests.push(JSON.parse(await readFile(join(testResultsDir, resultFile), "utf8"))); + res.tests.push(JSON.parse(await readFile(join(testResultsDir, resultFile), "utf8")) as TestResult); continue; } } diff --git a/packages/allure-jasmine/rollup.config.mjs b/packages/allure-jasmine/rollup.config.mjs index b7daae99a..b4692fa02 100644 --- a/packages/allure-jasmine/rollup.config.mjs +++ b/packages/allure-jasmine/rollup.config.mjs @@ -16,9 +16,9 @@ const createNodeEntry = (inputFile) => { "node:process", "node:path", "strip-ansi", - "allure-js-commons/new", - "allure-js-commons/new/sdk/node", - "allure-js-commons/new/internal" + "allure-js-commons", + "allure-js-commons/sdk/node", + "allure-js-commons/internal" ]; return [ diff --git a/packages/allure-jasmine/src/index.ts b/packages/allure-jasmine/src/index.ts index 556166325..3ed8fb932 100644 --- a/packages/allure-jasmine/src/index.ts +++ b/packages/allure-jasmine/src/index.ts @@ -19,7 +19,7 @@ import { getSuiteLabels, isPromise, setGlobalTestRuntime, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { AllureJasmineConfig, JasmineBeforeAfterFn } from "./model.js"; import { findAnyError, findMessageAboutThrow } from "./utils.js"; diff --git a/packages/allure-jasmine/src/model.ts b/packages/allure-jasmine/src/model.ts index e02514c9d..7499ceb87 100644 --- a/packages/allure-jasmine/src/model.ts +++ b/packages/allure-jasmine/src/model.ts @@ -1,4 +1,4 @@ -import { Config } from "allure-js-commons/new/sdk/node"; +import { Config } from "allure-js-commons/sdk/node"; export interface AllureJasmineConfig extends Config { testMode?: boolean; diff --git a/packages/allure-jasmine/test/spec/attachments.test.ts b/packages/allure-jasmine/test/spec/attachments.test.ts index 864311adb..3220aa9c7 100644 --- a/packages/allure-jasmine/test/spec/attachments.test.ts +++ b/packages/allure-jasmine/test/spec/attachments.test.ts @@ -4,7 +4,7 @@ import { runJasmineInlineTest } from "../utils"; it("handles json attachment", async () => { const { tests, attachments } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { attachment } = require("allure-js-commons/new"); + const { attachment } = require("allure-js-commons"); it("json", async () => { await attachment("Request body", JSON.stringify({ foo: "bar" }), "application/json"); diff --git a/packages/allure-jasmine/test/spec/description.test.ts b/packages/allure-jasmine/test/spec/description.test.ts index 8aab7a08a..0c8e9ecb1 100644 --- a/packages/allure-jasmine/test/spec/description.test.ts +++ b/packages/allure-jasmine/test/spec/description.test.ts @@ -4,7 +4,7 @@ import { runJasmineInlineTest } from "../utils"; it("sets description", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { description } = require("allure-js-commons/new"); + const { description } = require("allure-js-commons"); it("description", async () => { await description("foo"); @@ -19,7 +19,7 @@ it("sets description", async () => { it("sets html description", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { descriptionHtml } = require("allure-js-commons/new"); + const { descriptionHtml } = require("allure-js-commons"); it("descriptionHtml", async () => { await descriptionHtml("foo"); diff --git a/packages/allure-jasmine/test/spec/historyId.test.ts b/packages/allure-jasmine/test/spec/historyId.test.ts index e361f0e16..470a9b0a2 100644 --- a/packages/allure-jasmine/test/spec/historyId.test.ts +++ b/packages/allure-jasmine/test/spec/historyId.test.ts @@ -4,7 +4,7 @@ import { runJasmineInlineTest } from "../utils"; it("sets historyId", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { historyId } = require("allure-js-commons/new"); + const { historyId } = require("allure-js-commons"); it("historyId", async () => { await historyId("foo"); diff --git a/packages/allure-jasmine/test/spec/hooks.test.ts b/packages/allure-jasmine/test/spec/hooks.test.ts index bb9603b0a..29fe97c58 100644 --- a/packages/allure-jasmine/test/spec/hooks.test.ts +++ b/packages/allure-jasmine/test/spec/hooks.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Stage, Status } from "allure-js-commons/new/sdk/node"; +import { Stage, Status } from "allure-js-commons/sdk/node"; import { runJasmineInlineTest } from "../utils"; it("handles jasmine hooks in flat structure", async () => { diff --git a/packages/allure-jasmine/test/spec/labels.test.ts b/packages/allure-jasmine/test/spec/labels.test.ts index b7fb93923..881253c1b 100644 --- a/packages/allure-jasmine/test/spec/labels.test.ts +++ b/packages/allure-jasmine/test/spec/labels.test.ts @@ -19,7 +19,7 @@ it("sets labels", async () => { severity, story, tag, - } = require("allure-js-commons/new"); + } = require("allure-js-commons"); it("label", async () => { await label("foo", "bar"); diff --git a/packages/allure-jasmine/test/spec/links.test.ts b/packages/allure-jasmine/test/spec/links.test.ts index 1a734dffa..753a74ed1 100644 --- a/packages/allure-jasmine/test/spec/links.test.ts +++ b/packages/allure-jasmine/test/spec/links.test.ts @@ -5,7 +5,7 @@ import { runJasmineInlineTest } from "../utils"; it("sets links", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { link, links, issue, tms } = require('allure-js-commons/new'); + const { link, links, issue, tms } = require('allure-js-commons/'); it("link", async () => { await link("https://allurereport.org"); diff --git a/packages/allure-jasmine/test/spec/parameters.test.ts b/packages/allure-jasmine/test/spec/parameters.test.ts index 432d12a0e..5b9a7c735 100644 --- a/packages/allure-jasmine/test/spec/parameters.test.ts +++ b/packages/allure-jasmine/test/spec/parameters.test.ts @@ -4,7 +4,7 @@ import { runJasmineInlineTest } from "../utils"; it("sets parameters", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { parameter } = require("allure-js-commons/new"); + const { parameter } = require("allure-js-commons"); it("parameter", async () => { await parameter("param1", "paramValue1"); diff --git a/packages/allure-jasmine/test/spec/steps.test.ts b/packages/allure-jasmine/test/spec/steps.test.ts index 48e7089d0..9dca18cfa 100644 --- a/packages/allure-jasmine/test/spec/steps.test.ts +++ b/packages/allure-jasmine/test/spec/steps.test.ts @@ -5,7 +5,7 @@ import { runJasmineInlineTest } from "../utils"; it("single step", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { label, step } = require("allure-js-commons/new");; + const { label, step } = require("allure-js-commons");; it("step", async () => { await step("foo", async () => { @@ -24,7 +24,7 @@ it("single step", async () => { it("multiple steps", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { label, step } = require("allure-js-commons/new");; + const { label, step } = require("allure-js-commons");; it("step", async () => { await step("foo", async () => { @@ -55,7 +55,7 @@ it("multiple steps", async () => { it("nested steps", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { label, step } = require("allure-js-commons/new");; + const { label, step } = require("allure-js-commons");; it("step", async () => { await step("foo", async () => { @@ -82,7 +82,7 @@ it("nested steps", async () => { it("step with attachments", async () => { const { tests, attachments } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { attachment, step } = require("allure-js-commons/new");; + const { attachment, step } = require("allure-js-commons");; it("text attachment", async () => { await step("foo", async () => { @@ -106,7 +106,7 @@ it("step with attachments", async () => { it("step with assertion error", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { step } = require("allure-js-commons/new");; + const { step } = require("allure-js-commons");; it("step", async () => { await step("foo", async () => { @@ -153,7 +153,7 @@ it("step with assertion error", async () => { it("step with unexpected error", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { step } = require("allure-js-commons/new");; + const { step } = require("allure-js-commons");; it("step", async () => { await step("foo", async () => { @@ -196,7 +196,7 @@ it("step with unexpected error", async () => { it("step runtime api", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { step } = require("allure-js-commons/new");; + const { step } = require("allure-js-commons");; it("step", async () => { await step("step", (ctx) => { diff --git a/packages/allure-jasmine/test/spec/testCaseId.test.ts b/packages/allure-jasmine/test/spec/testCaseId.test.ts index bca3380c1..63be4283c 100644 --- a/packages/allure-jasmine/test/spec/testCaseId.test.ts +++ b/packages/allure-jasmine/test/spec/testCaseId.test.ts @@ -4,7 +4,7 @@ import { runJasmineInlineTest } from "../utils"; it("sets testCaseId", async () => { const { tests } = await runJasmineInlineTest({ "spec/test/sample.spec.js": ` - const { testCaseId } = require("allure-js-commons/new"); + const { testCaseId } = require("allure-js-commons"); it("testCaseId", async () => { await testCaseId("foo"); diff --git a/packages/allure-jasmine/test/utils.ts b/packages/allure-jasmine/test/utils.ts index 63ad0c933..b57af56d0 100644 --- a/packages/allure-jasmine/test/utils.ts +++ b/packages/allure-jasmine/test/utils.ts @@ -10,7 +10,7 @@ import { Status, TestResult, TestResultContainer, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; export type TestResultsByFullName = Record; diff --git a/packages/allure-jest/README.md b/packages/allure-jest/README.md index 4cd40bb45..dd49bdf93 100644 --- a/packages/allure-jest/README.md +++ b/packages/allure-jest/README.md @@ -61,7 +61,7 @@ The plugin provides custom global commands which allow to add additional info inside your tests: ```javascript -import { attachment, epic, parameter } from "allure-js-commons/new"; +import { attachment, epic, parameter } from "allure-js-commons"; it("my test", async () => { await attachment(currentTest.id(), screenshot, "image/png"); @@ -76,7 +76,7 @@ it("my test", async () => { ## Links usage ```js -import { link, issue } from "allure-js-commons/new"; +import { link, issue } from "allure-js-commons"; it("basic test", async () => { await link("https://allurereport.org", "Allure Report"); // link with name @@ -116,7 +116,7 @@ module.exports = config Then you can assign link using shorter notation: ```js -import { issue, tms, link } from "allure-js-commons/new"; +import { issue, tms, link } from "allure-js-commons"; it("basic test", async () => { await issue("Issue Name", "352"); diff --git a/packages/allure-jest/rollup.config.mjs b/packages/allure-jest/rollup.config.mjs index 1b107617d..edccacfd4 100644 --- a/packages/allure-jest/rollup.config.mjs +++ b/packages/allure-jest/rollup.config.mjs @@ -16,9 +16,9 @@ const createNodeEntry = (inputFile) => { "node:process", "node:path", "strip-ansi", - "allure-js-commons/new", - "allure-js-commons/new/sdk/node", - "allure-js-commons/new/internal", + "allure-js-commons", + "allure-js-commons/sdk/node", + "allure-js-commons/internal", "jest-environment-jsdom", "jest-environment-node" ]; diff --git a/packages/allure-jest/src/index.ts b/packages/allure-jest/src/index.ts index dd47c7c2e..e7b8e53a7 100644 --- a/packages/allure-jest/src/index.ts +++ b/packages/allure-jest/src/index.ts @@ -23,7 +23,7 @@ import { TestRuntime, getStatusFromError, getSuitesLabels, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { AllureJestConfig } from "./model.js"; import { getTestId, getTestPath } from "./utils.js"; diff --git a/packages/allure-jest/src/model.ts b/packages/allure-jest/src/model.ts index 9bd5ae83c..7157904a9 100644 --- a/packages/allure-jest/src/model.ts +++ b/packages/allure-jest/src/model.ts @@ -1,5 +1,5 @@ import { JestEnvironmentConfig } from "@jest/environment"; -import { Config } from "allure-js-commons/new/sdk/node"; +import { Config } from "allure-js-commons/sdk/node"; export interface AllureJestConfig extends JestEnvironmentConfig { projectConfig: JestEnvironmentConfig["projectConfig"] & { diff --git a/packages/allure-jest/test/spec/attachments.test.ts b/packages/allure-jest/test/spec/attachments.test.ts index 1df22df0f..289639f50 100644 --- a/packages/allure-jest/test/spec/attachments.test.ts +++ b/packages/allure-jest/test/spec/attachments.test.ts @@ -3,7 +3,7 @@ import { runJestInlineTest } from "../utils"; it("handles json attachment", async () => { const { tests, attachments } = await runJestInlineTest(` - const { attachment } = require("allure-js-commons/new"); + const { attachment } = require("allure-js-commons"); it("json", async () => { await attachment("Request body", JSON.stringify({ foo: "bar" }), "application/json"); diff --git a/packages/allure-jest/test/spec/description.test.ts b/packages/allure-jest/test/spec/description.test.ts index 95bf6a04a..6b5987bf2 100644 --- a/packages/allure-jest/test/spec/description.test.ts +++ b/packages/allure-jest/test/spec/description.test.ts @@ -3,7 +3,7 @@ import { runJestInlineTest } from "../utils"; it("sets description", async () => { const { tests } = await runJestInlineTest(` - const { description } = require("allure-js-commons/new"); + const { description } = require("allure-js-commons"); it("description", async () => { await description("foo"); @@ -16,7 +16,7 @@ it("sets description", async () => { it("sets html description", async () => { const { tests } = await runJestInlineTest(` - const { descriptionHtml } = require("allure-js-commons/new"); + const { descriptionHtml } = require("allure-js-commons"); it("descriptionHtml", async () => { await descriptionHtml("foo"); diff --git a/packages/allure-jest/test/spec/historyId.test.ts b/packages/allure-jest/test/spec/historyId.test.ts index 65a3bd749..5b4c1a35c 100644 --- a/packages/allure-jest/test/spec/historyId.test.ts +++ b/packages/allure-jest/test/spec/historyId.test.ts @@ -4,7 +4,7 @@ import { runJestInlineTest } from "../utils"; describe("historyId", () => { it("historyId", async () => { const { tests } = await runJestInlineTest(` - const { historyId } = require("allure-js-commons/new"); + const { historyId } = require("allure-js-commons"); it("historyId", async () => { await historyId("foo"); diff --git a/packages/allure-jest/test/spec/labels.test.ts b/packages/allure-jest/test/spec/labels.test.ts index 76ed5c5a5..b2b8cc53d 100644 --- a/packages/allure-jest/test/spec/labels.test.ts +++ b/packages/allure-jest/test/spec/labels.test.ts @@ -18,7 +18,7 @@ it("sets labels", async () => { severity, story, tag, - } = require("allure-js-commons/new"); + } = require("allure-js-commons"); it("label", async () => { await label("foo", "bar"); diff --git a/packages/allure-jest/test/spec/links.test.ts b/packages/allure-jest/test/spec/links.test.ts index 1181d3470..7383464bc 100644 --- a/packages/allure-jest/test/spec/links.test.ts +++ b/packages/allure-jest/test/spec/links.test.ts @@ -4,7 +4,7 @@ import { runJestInlineTest } from "../utils"; it("sets links", async () => { const { tests } = await runJestInlineTest(` - const { link, links, issue, tms } = require('allure-js-commons/new'); + const { link, links, issue, tms } = require('allure-js-commons'); it("link", async () => { await link("https://allurereport.org"); diff --git a/packages/allure-jest/test/spec/parameters.test.ts b/packages/allure-jest/test/spec/parameters.test.ts index 01fc9230f..93b504ec0 100644 --- a/packages/allure-jest/test/spec/parameters.test.ts +++ b/packages/allure-jest/test/spec/parameters.test.ts @@ -3,7 +3,7 @@ import { runJestInlineTest } from "../utils"; it("sets parameters", async () => { const { tests } = await runJestInlineTest(` - const { parameter } = require("allure-js-commons/new"); + const { parameter } = require("allure-js-commons"); it("parameter", async () => { await parameter("param1", "paramValue1"); diff --git a/packages/allure-jest/test/spec/retry.test.ts b/packages/allure-jest/test/spec/retry.test.ts index b03d5cfd3..1ff5a2877 100644 --- a/packages/allure-jest/test/spec/retry.test.ts +++ b/packages/allure-jest/test/spec/retry.test.ts @@ -3,7 +3,7 @@ import { runJestInlineTest } from "../utils"; it("should work for test with retries", async () => { const { tests, processError } = await runJestInlineTest(` - const { label } = require("allure-js-commons/new"); + const { label } = require("allure-js-commons"); jest.retryTimes(1); diff --git a/packages/allure-jest/test/spec/steps.test.ts b/packages/allure-jest/test/spec/steps.test.ts index ea59debcd..264d30c15 100644 --- a/packages/allure-jest/test/spec/steps.test.ts +++ b/packages/allure-jest/test/spec/steps.test.ts @@ -5,7 +5,7 @@ import { runJestInlineTest } from "../utils"; it("single step", async () => { const { tests } = await runJestInlineTest( ` - const { label, step } = require("allure-js-commons/new");; + const { label, step } = require("allure-js-commons"); it("step", async () => { await step("foo", async () => { @@ -24,7 +24,7 @@ it("single step", async () => { it("multiple steps", async () => { const { tests } = await runJestInlineTest( ` - const { label, step } = require("allure-js-commons/new");; + const { label, step } = require("allure-js-commons"); it("step", async () => { await step("foo", async () => { @@ -55,7 +55,7 @@ it("multiple steps", async () => { it("nested steps", async () => { const { tests } = await runJestInlineTest( ` - const { label, step } = require("allure-js-commons/new");; + const { label, step } = require("allure-js-commons"); it("step", async () => { await step("foo", async () => { @@ -82,7 +82,7 @@ it("nested steps", async () => { it("step with attachments", async () => { const { tests, attachments } = await runJestInlineTest( ` - const { attachment, step } = require("allure-js-commons/new");; + const { attachment, step } = require("allure-js-commons"); it("text attachment", async () => { await step("foo", async () => { @@ -106,7 +106,7 @@ it("step with attachments", async () => { it("step with assertion error", async () => { const { tests } = await runJestInlineTest( ` - const { step } = require("allure-js-commons/new");; + const { step } = require("allure-js-commons"); it("step", async () => { await step("foo", async () => { @@ -130,7 +130,7 @@ it("step with assertion error", async () => { it("step with unexpected error", async () => { const { tests } = await runJestInlineTest( ` - const { step } = require("allure-js-commons/new");; + const { step } = require("allure-js-commons"); it("step", async () => { await step("foo", async () => { @@ -152,7 +152,7 @@ it("step with unexpected error", async () => { it("step runtime api", async () => { const { tests } = await runJestInlineTest( ` - const { step } = require("allure-js-commons/new");; + const { step } = require("allure-js-commons"); it("step", async () => { await step("step", (ctx) => { diff --git a/packages/allure-jest/test/spec/testCaseId.test.ts b/packages/allure-jest/test/spec/testCaseId.test.ts index 34202cd31..45967086b 100644 --- a/packages/allure-jest/test/spec/testCaseId.test.ts +++ b/packages/allure-jest/test/spec/testCaseId.test.ts @@ -4,7 +4,7 @@ import { runJestInlineTest } from "../utils"; describe("testCaseId", () => { it("testCaseId", async () => { const { tests } = await runJestInlineTest(` - const { testCaseId } = require("allure-js-commons/new"); + const { testCaseId } = require("allure-js-commons"); it("testCaseId", async () => { await testCaseId("foo"); diff --git a/packages/allure-jest/test/utils.ts b/packages/allure-jest/test/utils.ts index 01ee9de16..1e879a886 100644 --- a/packages/allure-jest/test/utils.ts +++ b/packages/allure-jest/test/utils.ts @@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto"; import { mkdir, rm, writeFile } from "node:fs/promises"; import { join } from "node:path"; import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons"; -import { LinkType } from "allure-js-commons/new/sdk/node"; +import { LinkType } from "allure-js-commons/sdk/node"; export type TestResultsByFullName = Record; diff --git a/packages/allure-js-commons/index.ts b/packages/allure-js-commons/index.ts deleted file mode 100644 index a2d3d1ba6..000000000 --- a/packages/allure-js-commons/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -export { AllureRuntime } from "./src/current/AllureRuntime.js"; -export { - typeToExtension, - InMemoryAllureWriter, - FileSystemAllureWriter, - MessageAllureWriter, - AllureWriter, - AllureResults -} from "./src/current/writers/index.js"; -export { AllureConfig } from "./src/current/AllureConfig.js"; -export { AllureGroup } from "./src/current/AllureGroup.js"; -export { ExecutableItemWrapper } from "./src/current/ExecutableItemWrapper.js"; -export { AllureTest } from "./src/current/AllureTest.js"; -export { AllureStep } from "./src/current/ExecutableItemWrapper.js"; -export { isPromise } from "./src/current/isPromise.js"; -export { Allure, StepInterface } from "./src/current/Allure.js"; -export { StepBodyFunction, AllureCommandStep, AllureCommandStepExecutable } from "./src/current/AllureCommandStep.js"; -export { - AttachmentOptions, - MetadataMessage, - Attachment, - Category, - ExecutableItem, - StepResult, - Parameter, - StatusDetails, - Link, - Label, - ExecutorInfo, - TestResultContainer, - FixtureResult, - TestResult, - ContentType, - LabelName, - Severity, - Stage, - Status, - LinkType, - ParameterOptions, - StepMetadata, - AttachmentMetadata, - ImageDiffAttachment -} from "./src/current/model.js"; - -export { - allureIdRegexp, - allureIdRegexpGlobal, - allureLabelRegexp, - allureLabelRegexpGlobal, - allureReportFolder, - escapeRegExp, - getLabelsFromEnv, - getStatusFromError, - getSuitesLabels, - isAnyStepFailed, - md5, - readImageAsBase64, - serialize, - stripAscii, - extractMetadataFromString -} from "./src/current/utils.js"; - -export { AllureRuntimeApiInterface } from "./src/current/framework/index.js"; - -export { TestPlanV1, parseTestPlan } from "./src/current/testplan.js"; diff --git a/packages/allure-js-commons/internal.ts b/packages/allure-js-commons/internal.ts deleted file mode 100644 index 16ee8b01f..000000000 --- a/packages/allure-js-commons/internal.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { - ALLURE_SKIPPED_BY_TEST_PLAN_LABEL, - ALLURE_METADATA_CONTENT_TYPE, - ALLURE_IMAGEDIFF_CONTENT_TYPE, -} from "./src/current/model.js"; diff --git a/packages/allure-js-commons/package.json b/packages/allure-js-commons/package.json index 6388f9541..62f25df0f 100644 --- a/packages/allure-js-commons/package.json +++ b/packages/allure-js-commons/package.json @@ -23,33 +23,25 @@ "import": "./dist/esm/internal.js", "require": "./dist/cjs/internal.js" }, - "./new": { - "import": "./dist/esm/src/new/index.js", - "require": "./dist/cjs/src/new/index.js" + "./browser": { + "import": "./dist/esm/browser/index.js", + "require": "./dist/cjs/browser/index.js" }, - "./new/internal": { - "import": "./dist/esm/src/new/internal.js", - "require": "./dist/cjs/src/new/internal.js" + "./node": { + "import": "./dist/esm/node/index.js", + "require": "./dist/cjs/node/index.js" }, - "./new/browser": { - "import": "./dist/esm/src/new/browser/index.js", - "require": "./dist/cjs/src/new/browser/index.js" + "./sdk": { + "import": "./dist/esm/sdk/index.js", + "require": "./dist/cjs/sdk/index.js" }, - "./new/node": { - "import": "./dist/esm/src/new/node/index.js", - "require": "./dist/cjs/src/new/node/index.js" + "./sdk/node": { + "import": "./dist/esm/sdk/node/index.js", + "require": "./dist/cjs/sdk/node/index.js" }, - "./new/sdk": { - "import": "./dist/esm/src/new/sdk/index.js", - "require": "./dist/cjs/src/new/sdk/index.js" - }, - "./new/sdk/node": { - "import": "./dist/esm/src/new/sdk/node/index.js", - "require": "./dist/cjs/src/new/sdk/node/index.js" - }, - "./new/sdk/browser": { - "import": "./dist/esm/src/new/sdk/browser/index.js", - "require": "./dist/cjs/src/new/sdk/browser/index.js" + "./sdk/browser": { + "import": "./dist/esm/sdk/browser/index.js", + "require": "./dist/cjs/sdk/browser/index.js" } }, "main": "./dist/cjs/index.js", @@ -63,9 +55,8 @@ "compile:esm": "tsc --project ./tsconfig.esm.json", "compile:cjs": "tsc --project ./tsconfig.json", "compile:fixup": "ts-node --project ./tsconfig.json ./scripts/fixup.ts", - "lint": "eslint ./src ./test ./index.ts ./internal.ts --ext .ts", - "lint:fix": "eslint ./src ./test ./index.ts ./internal.ts --ext .ts --fix", - "_test": "ts-node --project test/tsconfig.json test/runner.ts", + "lint": "eslint ./src ./test --ext .ts", + "lint:fix": "eslint ./src ./test --ext .ts --fix", "test": "vitest run" }, "dependencies": { diff --git a/packages/allure-js-commons/src/new/TestRuntime.ts b/packages/allure-js-commons/src/TestRuntime.ts similarity index 100% rename from packages/allure-js-commons/src/new/TestRuntime.ts rename to packages/allure-js-commons/src/TestRuntime.ts diff --git a/packages/allure-js-commons/src/current/Allure.ts b/packages/allure-js-commons/src/current/Allure.ts deleted file mode 100644 index b4a666e1c..000000000 --- a/packages/allure-js-commons/src/current/Allure.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { AllureRuntime } from "./AllureRuntime.js"; -import { AllureTest } from "./AllureTest.js"; -import { ExecutableItemWrapper } from "./ExecutableItemWrapper.js"; -import { AllureRuntimeApiInterface } from "./framework/index.js"; -import { AttachmentOptions, Category, ContentType, LabelName, LinkType, ParameterOptions, Status } from "./model.js"; - -// FIXME: step and attachment should be the same for each reporter implementation -export abstract class Allure implements Omit { - protected abstract get currentTest(): AllureTest; // test only - protected abstract get currentExecutable(): ExecutableItemWrapper; // step or test - - protected constructor(protected runtime: AllureRuntime) {} - - testCaseId(id: string): void { - this.currentTest.testCaseId = id; - } - - historyId(id: string): void { - this.currentTest.historyId = id; - } - - public epic(epic: string): void { - this.label(LabelName.EPIC, epic); - } - - public feature(feature: string): void { - this.label(LabelName.FEATURE, feature); - } - - public story(story: string): void { - this.label(LabelName.STORY, story); - } - - public suite(name: string): void { - this.label(LabelName.SUITE, name); - } - - public parentSuite(name: string): void { - this.label(LabelName.PARENT_SUITE, name); - } - - public subSuite(name: string): void { - this.label(LabelName.SUB_SUITE, name); - } - - public label(name: string, value: string): void { - this.currentTest.addLabel(name, value); - } - - public parameter(name: string, value: any, options?: ParameterOptions): void { - this.currentExecutable.parameter(name, value, options); - } - - public link(url: string, name?: string, type?: string): void { - this.currentTest.addLink(url, name, type); - } - - public issue(name: string, url: string): void { - this.link(url, name, LinkType.ISSUE); - } - - public tms(name: string, url: string): void { - this.link(url, name, LinkType.TMS); - } - - public description(markdown: string): void { - this.currentExecutable.description = markdown; - } - - public descriptionHtml(html: string): void { - this.currentExecutable.descriptionHtml = html; - } - - public owner(owner: string): void { - this.label(LabelName.OWNER, owner); - } - - public severity(severity: string): void { - this.label(LabelName.SEVERITY, severity); - } - - public layer(layer: string): void { - this.label(LabelName.LAYER, layer); - } - - public id(allureId: string): void { - this.label(LabelName.ALLURE_ID, allureId); - } - - public tag(tag: string): void { - this.label(LabelName.TAG, tag); - } - - public writeEnvironmentInfo(info: Record): void { - this.runtime.writeEnvironmentInfo(info); - } - - public writeCategoriesDefinitions(categories: Category[]): void { - this.runtime.writeCategoriesDefinitions(categories); - } - - public abstract attachment( - name: string, - content: Buffer | string, - options: ContentType | string | AttachmentOptions, - ): void; - - public abstract logStep(name: string, status?: Status): void; - - public abstract step(name: string, body: (step: StepInterface) => T): T; -} - -export interface StepInterface { - parameter(name: string, value: string): void; - name(name: string): void; -} diff --git a/packages/allure-js-commons/src/current/AllureCommandStep.ts b/packages/allure-js-commons/src/current/AllureCommandStep.ts deleted file mode 100644 index c0302b41c..000000000 --- a/packages/allure-js-commons/src/current/AllureCommandStep.ts +++ /dev/null @@ -1,276 +0,0 @@ -import stripAnsi from "strip-ansi"; -import { AllureRuntime } from "./AllureRuntime.js"; -import { - AttachmentMetadata, - ContentType, - ExecutableItem, - LabelName, - LinkType, - MetadataMessage, - ParameterOptions, - Stage, - Status, - StepMetadata, -} from "./model.js"; - -export type StepBodyFunction = ( - this: AllureCommandStepExecutable, - step: AllureCommandStepExecutable, -) => T | Promise; - -export interface AllureCommandStep { - name: string; - - attachments: AttachmentMetadata[]; - - metadata: T; - - label(label: string, value: string): void | Promise; - - link(url: string, name?: string, type?: string): void | Promise; - - parameter(name: string, value: string, options?: ParameterOptions): void | Promise; - - epic(epic: string): void | Promise; - - feature(feature: string): void | Promise; - - story(story: string): void | Promise; - - suite(name: string): void | Promise; - - parentSuite(name: string): void | Promise; - - subSuite(name: string): void | Promise; - - owner(owner: string): void | Promise; - - severity(severity: string): void | Promise; - - tag(tag: string): void | Promise; - - issue(issue: string, url: string): void | Promise; - - tms(issue: string, url: string): void | Promise; - - attach(name: string, content: Buffer | string, options: ContentType | string): void | Promise; - - description(content: string): void | Promise; -} - -export class AllureCommandStepExecutable implements AllureCommandStep { - name: string = ""; - - attachments: AttachmentMetadata[] = []; - - metadata: MetadataMessage = {}; - - constructor(name: string) { - this.name = name; - } - - /** - * Recursively writes attachments from the given step and all it's children - * Mutates given step object! - */ - static toExecutableItem(runtime: AllureRuntime, stepMetadata: StepMetadata): ExecutableItem { - const executable: ExecutableItem = { - ...stepMetadata, - attachments: [], - steps: [], - }; - - if (stepMetadata.attachments?.length > 0) { - stepMetadata.attachments.forEach((attachment) => { - const attachmentContent = Buffer.from(attachment.content, attachment.encoding); - const attachmentFilename = runtime.writeAttachment(attachmentContent, attachment.type, attachment.encoding); - - executable.attachments.push({ - name: attachment.name, - type: attachment.type, - source: attachmentFilename, - }); - }); - } - - if (stepMetadata.steps?.length > 0) { - executable.steps = stepMetadata.steps.map((nestedStep) => - AllureCommandStepExecutable.toExecutableItem(runtime, nestedStep), - ); - } - - return executable; - } - - label(label: string, value: string): void { - if (!this.metadata.labels) { - this.metadata.labels = []; - } - - this.metadata.labels.push({ - name: label, - value, - }); - } - - link(url: string, name?: string, type?: string): void { - if (!this.metadata.links) { - this.metadata.links = []; - } - - this.metadata.links.push({ - name, - url, - type, - }); - } - - parameter(name: string, value: any, options?: ParameterOptions): void { - if (!this.metadata.parameter) { - this.metadata.parameter = []; - } - - this.metadata.parameter.push({ - name, - value: JSON.stringify(value), - excluded: options?.excluded || false, - mode: options?.mode, - }); - } - - epic(epic: string) { - this.label(LabelName.EPIC, epic); - } - - feature(feature: string) { - this.label(LabelName.FEATURE, feature); - } - - story(story: string) { - this.label(LabelName.STORY, story); - } - - suite(name: string) { - this.label(LabelName.SUITE, name); - } - - parentSuite(name: string) { - this.label(LabelName.PARENT_SUITE, name); - } - - subSuite(name: string) { - this.label(LabelName.SUB_SUITE, name); - } - - owner(owner: string) { - this.label(LabelName.OWNER, owner); - } - - severity(severity: string) { - this.label(LabelName.SEVERITY, severity); - } - - tag(tag: string) { - this.label(LabelName.TAG, tag); - } - - issue(name: string, url: string) { - this.link(url, name, LinkType.ISSUE); - } - - tms(name: string, url: string) { - this.link(url, name, LinkType.TMS); - } - - attach(content: string | Buffer, type: string, name: string = "attachment"): void { - const isBuffer = Buffer.isBuffer(content); - - this.attachments.push({ - name, - content: isBuffer ? content.toString("base64") : content, - encoding: isBuffer ? "base64" : "utf8", - type, - }); - } - - description(content: string): void { - this.metadata.description = content; - } - - async step(name: string, body: StepBodyFunction): Promise { - if (!this.metadata.steps) { - this.metadata.steps = []; - } - - const nestedStep = new AllureCommandStepExecutable(name); - // eslint-disable-next-line @typescript-eslint/require-await - await nestedStep.run(body, async ({ labels = [], links = [], parameter = [], steps = [] }) => { - this.metadata.labels = (this.metadata.labels || []).concat(labels); - this.metadata.links = (this.metadata.links || []).concat(links); - this.metadata.parameter = (this.metadata.parameter || []).concat(parameter); - this.metadata.steps = (this.metadata.steps || []).concat(steps); - }); - } - - async start(body: StepBodyFunction): Promise { - return await new Promise((resolve) => - // eslint-disable-next-line @typescript-eslint/require-await - this.run(body, async (result) => resolve(result)), - ); - } - - async run(body: StepBodyFunction, messageEmitter: (message: MetadataMessage) => Promise): Promise { - const startDate = new Date().getTime(); - - try { - await body.call(this, this); - - const { steps = [], description = "", descriptionHtml = "", ...metadata } = this.metadata; - - await messageEmitter({ - ...metadata, - steps: [ - { - name: this.name, - start: startDate, - stop: new Date().getTime(), - stage: Stage.FINISHED, - status: Status.PASSED, - statusDetails: {}, - attachments: this.attachments, - parameters: this.metadata.parameter || [], // when in stepFn,like this.parameter('xx', 'xxx'),emit parameters data to display, - steps, - description, - descriptionHtml, - }, - ], - }); - } catch (e: any) { - const { steps = [], description = "", descriptionHtml = "", ...metadata } = this.metadata; - - await messageEmitter({ - ...metadata, - steps: [ - { - name: this.name, - start: startDate, - stop: new Date().getTime(), - stage: Stage.FINISHED, - status: Status.BROKEN, - statusDetails: { - message: stripAnsi((e.message || "") as string), - trace: stripAnsi((e.stack || "") as string), - }, - attachments: this.attachments, - parameters: this.metadata.parameter || [], // when in stepFn,like this.parameter('xx', 'xxx'),emit parameters data to display, - steps, - description, - descriptionHtml, - }, - ], - }); - - throw e; - } - } -} diff --git a/packages/allure-js-commons/src/current/AllureConfig.ts b/packages/allure-js-commons/src/current/AllureConfig.ts deleted file mode 100644 index d8e29a5f3..000000000 --- a/packages/allure-js-commons/src/current/AllureConfig.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { TestResult } from "./model.js"; -import { AllureWriter } from "./writers/index.js"; - -export interface AllureConfig { - readonly resultsDir: string; - readonly writer?: AllureWriter; - readonly testMapper?: (test: TestResult) => TestResult | null; -} diff --git a/packages/allure-js-commons/src/current/AllureGroup.ts b/packages/allure-js-commons/src/current/AllureGroup.ts deleted file mode 100644 index 78e6a871b..000000000 --- a/packages/allure-js-commons/src/current/AllureGroup.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { AllureRuntime } from "./AllureRuntime.js"; -import { AllureTest } from "./AllureTest.js"; -import { ExecutableItemWrapper } from "./ExecutableItemWrapper.js"; -import { fixtureResult, testResultContainer } from "./constructors.js"; -import { TestResultContainer } from "./model.js"; - -export class AllureGroup { - private testResultContainer: TestResultContainer = testResultContainer(); - - constructor(private readonly runtime: AllureRuntime) {} - - startGroup(name?: string): AllureGroup { - const group = new AllureGroup(this.runtime); - this.testResultContainer.children.push(group.uuid); - group.name = name || "Unnamed"; - return group; - } - - startTest(name?: string, start?: number): AllureTest { - const test = new AllureTest(this.runtime, start); - - this.testResultContainer.children.push(test.uuid); - test.name = name || "Unnamed"; - - return test; - } - - endGroup(): void { - // TODO: test that children ended - this.runtime.writeGroup(this.testResultContainer); - } - - get uuid(): string { - return this.testResultContainer.uuid; - } - - get name(): string { - return this.testResultContainer.name || ""; - } - - set name(name: string) { - this.testResultContainer.name = name; - } - - addBefore(): ExecutableItemWrapper { - const result = fixtureResult(); - this.testResultContainer.befores.push(result); - return new ExecutableItemWrapper(result); - } - - addAfter(): ExecutableItemWrapper { - const result = fixtureResult(); - this.testResultContainer.afters.push(result); - return new ExecutableItemWrapper(result); - } -} diff --git a/packages/allure-js-commons/src/current/AllureRuntime.ts b/packages/allure-js-commons/src/current/AllureRuntime.ts deleted file mode 100644 index 44a5de664..000000000 --- a/packages/allure-js-commons/src/current/AllureRuntime.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { randomUUID } from "crypto"; -import { PathLike } from "fs"; -import { AllureConfig } from "./AllureConfig.js"; -import { AllureGroup } from "./AllureGroup.js"; -import { AttachmentOptions, Category, ContentType, TestResult, TestResultContainer } from "./model.js"; -import { AllureWriter, FileSystemAllureWriter, typeToExtension } from "./writers/index.js"; - -const buildAttachmentFileName = (options: ContentType | string | AttachmentOptions): string => { - if (typeof options === "string") { - options = { contentType: options }; - } - - const extension = typeToExtension(options); - return `${randomUUID()}-attachment${extension}`; -}; - -export class AllureRuntime { - writer: AllureWriter; - - constructor(private config: AllureConfig) { - this.writer = config.writer || new FileSystemAllureWriter(config); - } - - startGroup(name?: string): AllureGroup { - const allureContainer = new AllureGroup(this); - allureContainer.name = name || "Unnamed"; - return allureContainer; - } - - writeResult(result: TestResult): void { - const modifiedResult = this.config.testMapper !== undefined ? this.config.testMapper(result) : result; - if (modifiedResult != null) { - this.writer.writeResult(modifiedResult); - } - } - - writeGroup(result: TestResultContainer): void { - this.writer.writeGroup(result); - } - - writeAttachment( - content: Buffer | string, - options: ContentType | string | AttachmentOptions, - encoding?: BufferEncoding, - ): string { - const fileName = buildAttachmentFileName(options); - this.writer.writeAttachment(fileName, content, encoding); - return fileName; - } - - writeAttachmentFromPath(fromPath: PathLike, options: ContentType | string | AttachmentOptions): string { - const fileName = buildAttachmentFileName(options); - this.writer.writeAttachmentFromPath(fromPath, fileName); - return fileName; - } - - writeEnvironmentInfo(info?: Record): void { - this.writer.writeEnvironmentInfo(info || process.env); - } - - writeCategoriesDefinitions(categories: Category[]): void { - const serializedCategories = categories.map((c) => { - if (c.messageRegex instanceof RegExp) { - c.messageRegex = c.messageRegex.source; - } - if (c.traceRegex instanceof RegExp) { - c.traceRegex = c.traceRegex.source; - } - return c; - }); - this.writer.writeCategoriesDefinitions(serializedCategories); - } -} diff --git a/packages/allure-js-commons/src/current/AllureTest.ts b/packages/allure-js-commons/src/current/AllureTest.ts deleted file mode 100644 index 121192a05..000000000 --- a/packages/allure-js-commons/src/current/AllureTest.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { AllureCommandStepExecutable } from "./AllureCommandStep.js"; -import { AllureRuntime } from "./AllureRuntime.js"; -import { ExecutableItemWrapper } from "./ExecutableItemWrapper.js"; -import { testResult } from "./constructors.js"; -import { ExecutableItem, LinkType, MetadataMessage, TestResult } from "./model.js"; -import { getLabelsFromEnv, md5 } from "./utils.js"; - -export class AllureTest extends ExecutableItemWrapper { - private readonly testResult: TestResult; - private historyIdSetManually = false; - - constructor( - private readonly runtime: AllureRuntime, - start: number = Date.now(), - ) { - super(testResult()); - - const globalLabels = getLabelsFromEnv(); - - this.testResult = this.wrappedItem as TestResult; - this.testResult.start = start; - - globalLabels.forEach((label) => this.addLabel(label.name, label.value)); - } - - endTest(stop: number = Date.now()): void { - this.testResult.stop = stop; - this.runtime.writeResult(this.testResult); - // TODO: test that child steps ended - } - - get uuid(): string { - return this.testResult.uuid; - } - - set historyId(id: string) { - this.historyIdSetManually = true; - this.testResult.historyId = id; - } - - set fullName(fullName: string) { - this.testResult.fullName = fullName; - } - - set testCaseId(testCaseId: string) { - this.testResult.testCaseId = testCaseId; - } - - addLabel(name: string, value: string): void { - this.testResult.labels.push({ name, value }); - } - - addLink(url: string, name?: string, type?: string): void { - this.testResult.links.push({ name, url, type }); - } - - addIssueLink(url: string, name: string): void { - this.addLink(url, name, LinkType.ISSUE); - } - - addTmsLink(url: string, name: string): void { - this.addLink(url, name, LinkType.TMS); - } - - /** - * Calculates test `historyId` based on `testCaseId` and parameters - * Does nothing if `historyId` is already set - */ - calculateHistoryId(): void { - if (this.historyIdSetManually) { - return; - } - - const tcId = this.testResult.testCaseId - ? this.testResult.testCaseId - : this.testResult.fullName - ? md5(this.testResult.fullName) - : null; - - if (!tcId) { - return; - } - - const paramsString = this.testResult.parameters - .filter((p) => !p?.excluded) - .sort((a, b) => a.name?.localeCompare(b?.name) || a.value?.localeCompare(b?.value)) - .map((p) => `${p.name ?? "null"}:${p.value ?? "null"}`) - .join(","); - const paramsHash = md5(paramsString); - - this.historyId = `${tcId}:${paramsHash}`; - } - - /** - * Processes metadata message recieved and applies all it's fields to the test - * - * @example - * ```typescript - * // apply entire metadata to the test - * test.applyMetadata(metadata) - * - * // will apply everything except steps - * test.applyMetadata(metadata, () => {}) - * - * // will apply steps metadata to another test - * testA.applyMetadata(step, () => { - * testB.addStep(step) - * }) - * ``` - * - * @param metadata Metadata message recieved from Allure Runtime API - * @param stepApplyFn Function that processes metadata. By default, all the steps - * will be added to the test - */ - applyMetadata(metadata: Partial, stepApplyFn?: (step: ExecutableItem) => void) { - const { - attachments = [], - labels = [], - links = [], - parameter = [], - steps = [], - description, - descriptionHtml, - displayName, - historyId, - testCaseId, - } = metadata; - - labels.forEach((label) => { - this.addLabel(label.name, label.value); - }); - links.forEach((link) => { - this.addLink(link.url, link.name, link.type); - }); - parameter.forEach((param) => { - this.parameter(param.name, param.value, { - excluded: param.excluded, - mode: param.mode, - }); - }); - attachments.forEach((attachment) => { - const attachmentFilename = this.runtime.writeAttachment(attachment.content, attachment.type, attachment.encoding); - - this.addAttachment( - attachment.name, - { - contentType: attachment.type, - }, - attachmentFilename, - ); - }); - - if (description) { - this.description = description; - } - - if (descriptionHtml) { - this.descriptionHtml = descriptionHtml; - } - - if (displayName) { - this.name = displayName; - } - - if (testCaseId) { - this.testCaseId = testCaseId; - } - - if (historyId) { - this.historyId = historyId; - } - - steps.forEach((stepMetadata) => { - const step = AllureCommandStepExecutable.toExecutableItem(this.runtime, stepMetadata); - - if (stepApplyFn) { - stepApplyFn(step); - return; - } - - this.addStep(step); - }); - } -} diff --git a/packages/allure-js-commons/src/current/ExecutableItemWrapper.ts b/packages/allure-js-commons/src/current/ExecutableItemWrapper.ts deleted file mode 100644 index f40028eb4..000000000 --- a/packages/allure-js-commons/src/current/ExecutableItemWrapper.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { stepResult } from "./constructors.js"; -import { isPromise } from "./isPromise.js"; -import { - AttachmentOptions, - ContentType, - ExecutableItem, - FixtureResult, - ParameterOptions, - Stage, - Status, - StatusDetails, - StepResult, - TestResult, -} from "./model.js"; -import { isAllStepsEnded, isAnyStepFailed, serialize } from "./utils.js"; - -export class ExecutableItemWrapper { - constructor(private readonly info: FixtureResult | TestResult) {} - - get wrappedItem(): FixtureResult | TestResult { - return this.info; - } - - public set name(name: string) { - this.info.name = name; - } - - public set description(description: string | undefined) { - this.info.description = description; - } - - public set descriptionHtml(descriptionHtml: string | undefined) { - this.info.descriptionHtml = descriptionHtml; - } - - public set status(status: Status | undefined) { - this.info.status = status; - } - - public get status(): Status | undefined { - return this.info.status; - } - - public set statusDetails(details: StatusDetails) { - this.info.statusDetails = details; - } - - public set detailsMessage(message: string | undefined) { - this.info.statusDetails.message = message; - } - - public set detailsTrace(trace: string | undefined) { - this.info.statusDetails.trace = trace; - } - - public set stage(stage: Stage) { - this.info.stage = stage; - } - - public parameter(name: string, value: any, options?: ParameterOptions): void { - this.info.parameters.push({ ...options, name, value: serialize(value) }); - } - - public get isAnyStepFailed() { - return isAnyStepFailed(this.info); - } - - public get isAllStepsEnded() { - return isAllStepsEnded(this.info); - } - - /** - * @deprecated use parameter() instead. - */ - public addParameter(name: string, value: string, options?: ParameterOptions): void { - this.parameter(name, value, options); - } - - public addAttachment(name: string, options: ContentType | string | AttachmentOptions, fileName: string): void { - if (typeof options === "string") { - options = { contentType: options }; - } - - this.info.attachments.push({ name, type: options.contentType, source: fileName }); - } - - public startStep(name: string, start?: number): AllureStep { - const result = stepResult(); - this.info.steps.push(result); - - const allureStep = new AllureStep(result, start); - allureStep.name = name; - return allureStep; - } - - public wrap(fun: (...args: any[]) => T) { - return (...args: any[]): T => { - this.stage = Stage.RUNNING; - let result; - try { - result = fun(args); - } catch (error) { - this.stage = Stage.INTERRUPTED; - this.status = Status.BROKEN; - if (error) { - this.detailsMessage = (error as Error).message || ""; - this.detailsTrace = (error as Error).stack || ""; - } - throw error; - } - if (isPromise(result)) { - const promise = result as any as Promise; - return promise - .then((res) => { - this.status = Status.PASSED; - this.stage = Stage.FINISHED; - return res; - }) - .catch((error) => { - this.stage = Stage.INTERRUPTED; - this.status = Status.BROKEN; - if (error) { - this.detailsMessage = (error as Error).message || ""; - this.detailsTrace = (error as Error).stack || ""; - } - throw error; - }) as any as T; - } else { - this.status = Status.PASSED; - this.stage = Stage.FINISHED; - return result; - } - }; - } - - public addStep(step: ExecutableItem): void { - this.info.steps.push(step); - } -} - -// This class is here because of circular dependency with ExecutableItemWrapper -export class AllureStep extends ExecutableItemWrapper { - constructor( - // eslint-disable-next-line @typescript-eslint/no-shadow - private readonly stepResult: StepResult, - start: number = Date.now(), - ) { - super(stepResult); - this.stepResult.start = start; - } - - endStep(stop: number = Date.now()): void { - this.stepResult.stop = stop; - } -} diff --git a/packages/allure-js-commons/src/current/constructors.ts b/packages/allure-js-commons/src/current/constructors.ts deleted file mode 100644 index 04f37c8d1..000000000 --- a/packages/allure-js-commons/src/current/constructors.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { randomUUID } from "crypto"; -import { FixtureResult, Stage, Status, StepResult, TestResult, TestResultContainer } from "./model.js"; - -export const testResultContainer = (): TestResultContainer => { - return { - uuid: randomUUID(), - children: [], - befores: [], - afters: [], - }; -}; - -export const fixtureResult = (): FixtureResult => { - return { - status: Status.BROKEN, - statusDetails: {}, - stage: Stage.PENDING, - steps: [], - attachments: [], - parameters: [], - }; -}; - -export const stepResult = (): StepResult => { - return { - status: undefined, - statusDetails: {}, - stage: Stage.PENDING, - steps: [], - attachments: [], - parameters: [], - }; -}; - -export const testResult = (): TestResult => { - return { - uuid: randomUUID(), - historyId: randomUUID(), - status: undefined, - statusDetails: {}, - stage: Stage.PENDING, - steps: [], - attachments: [], - parameters: [], - labels: [], - links: [], - }; -}; diff --git a/packages/allure-js-commons/src/current/framework/index.ts b/packages/allure-js-commons/src/current/framework/index.ts deleted file mode 100644 index 5067e8ece..000000000 --- a/packages/allure-js-commons/src/current/framework/index.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { StepBodyFunction } from "../AllureCommandStep.js"; -import { ParameterOptions } from "../model.js"; - -export interface AllureRuntimeApiInterface { - label(name: string, value: string): void; - - parameter(name: string, value: any, options?: ParameterOptions): void; - - link(url: string, name?: string, type?: string): void; - - attachment(content: string | Buffer, type: string): void; - - step(name: string, body: StepBodyFunction): void; - - epic(epic: string): void; - - feature(feature: string): void; - - story(story: string): void; - - suite(name: string): void; - - parentSuite(name: string): void; - - subSuite(name: string): void; - - owner(owner: string): void; - - severity(severity: string): void; - - layer(layer: string): void; - - id(allureId: string): void; - - tag(tag: string): void; - - issue(name: string, url: string): void; - - tms(name: string, url: string): void; - - description(markdown: string): void; - - descriptionHtml(html: string): void; - - testCaseId(id: string): void; - - historyId(id: string): void; -} diff --git a/packages/allure-js-commons/src/current/isPromise.ts b/packages/allure-js-commons/src/current/isPromise.ts deleted file mode 100644 index 47cd02b3b..000000000 --- a/packages/allure-js-commons/src/current/isPromise.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const isPromise = (obj: any): boolean => - !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function"; diff --git a/packages/allure-js-commons/src/current/model.ts b/packages/allure-js-commons/src/current/model.ts deleted file mode 100644 index c99b7dd6a..000000000 --- a/packages/allure-js-commons/src/current/model.ts +++ /dev/null @@ -1,203 +0,0 @@ -export const ALLURE_METADATA_CONTENT_TYPE = "application/vnd.allure.metadata+json"; -export const ALLURE_IMAGEDIFF_CONTENT_TYPE = "application/vnd.allure.image.diff"; -export const ALLURE_SKIPPED_BY_TEST_PLAN_LABEL = "allure-skipped-by-test-plan"; - -export interface AttachmentMetadata { - name: string; - type: string; - content: string; - encoding: BufferEncoding; -} - -export interface StepMetadata extends Omit { - steps: StepMetadata[]; - attachments: AttachmentMetadata[]; -} - -export interface MetadataMessage { - attachments?: AttachmentMetadata[]; - displayName?: string; - testCaseId?: string; - historyId?: string; - labels?: Label[]; - links?: Link[]; - parameter?: Parameter[]; - description?: string; - descriptionHtml?: string; - steps?: StepMetadata[]; -} - -export interface Attachment { - name: string; - type: string; - source: string; -} - -export interface AttachmentOptions { - contentType: ContentType | string; - fileExtension?: string; -} - -export interface Label { - name: LabelName | string; - value: string; -} - -export interface Link { - name?: string; - url: string; - type?: LinkType | string; -} - -export interface Parameter { - name: string; - value: string; - excluded?: boolean; - mode?: "hidden" | "masked" | "default"; -} - -export type ParameterOptions = Pick; - -export interface StatusDetails { - message?: string; - trace?: string; -} - -export interface ExecutableItem { - name?: string; - status?: Status; - statusDetails: StatusDetails; - stage: Stage; - description?: string; - descriptionHtml?: string; - steps: StepResult[]; - attachments: Attachment[]; - parameters: Parameter[]; - start?: number; - stop?: number; -} - -export type FixtureResult = ExecutableItem; -export type StepResult = ExecutableItem; - -export interface TestResult extends ExecutableItem { - uuid: string; - historyId: string; - fullName?: string; - testCaseId?: string; - labels: Label[]; - links: Link[]; -} - -export interface TestResultContainer { - uuid: string; - name?: string; - children: string[]; - befores: FixtureResult[]; - afters: FixtureResult[]; -} - -export interface Category { - name?: string; - description?: string; - descriptionHtml?: string; - messageRegex?: string | RegExp; - traceRegex?: string | RegExp; - matchedStatuses?: Status[]; - flaky?: boolean; -} - -export interface ExecutorInfo { - name?: string; - type?: string; - url?: string; - buildOrder?: number; - buildName?: string; - buildUrl?: string; - reportUrl?: string; - reportName?: string; -} - -/* eslint-disable no-shadow */ -export enum Status { - FAILED = "failed", - BROKEN = "broken", - PASSED = "passed", - SKIPPED = "skipped", -} - -/* eslint-disable no-shadow */ -export enum Stage { - SCHEDULED = "scheduled", - RUNNING = "running", - FINISHED = "finished", - PENDING = "pending", - INTERRUPTED = "interrupted", -} - -/* eslint-disable no-shadow */ -export enum LabelName { - ALLURE_ID = "ALLURE_ID", - /** - * @deprecated please use ALLURE_ID instead - */ - AS_ID = ALLURE_ID, - SUITE = "suite", - PARENT_SUITE = "parentSuite", - SUB_SUITE = "subSuite", - EPIC = "epic", - FEATURE = "feature", - STORY = "story", - SEVERITY = "severity", - TAG = "tag", - OWNER = "owner", - LEAD = "lead", - HOST = "host", - THREAD = "thread", - TEST_METHOD = "testMethod", - TEST_CLASS = "testClass", - PACKAGE = "package", - FRAMEWORK = "framework", - LANGUAGE = "language", - LAYER = "layer", -} - -/* eslint-disable no-shadow */ -export enum Severity { - BLOCKER = "blocker", - CRITICAL = "critical", - NORMAL = "normal", - MINOR = "minor", - TRIVIAL = "trivial", -} - -/* eslint-disable no-shadow */ -export enum ContentType { - TEXT = "text/plain", - XML = "application/xml", - HTML = "text/html", - CSV = "text/csv", - TSV = "text/tab-separated-values", - CSS = "text/css", - URI = "text/uri-list", - SVG = "image/svg+xml", - PNG = "image/png", - JSON = "application/json", - ZIP = "application/zip", - WEBM = "video/webm", - JPEG = "image/jpeg", - MP4 = "video/mp4", -} - -/* eslint-disable no-shadow */ -export enum LinkType { - ISSUE = "issue", - TMS = "tms", -} - -export interface ImageDiffAttachment { - expected: string | undefined; // data:image;base64, - actual: string | undefined; // data:image;base64, - diff: string | undefined; // data:image;base64, - name: string; -} diff --git a/packages/allure-js-commons/src/current/testplan.ts b/packages/allure-js-commons/src/current/testplan.ts deleted file mode 100644 index 56ad83267..000000000 --- a/packages/allure-js-commons/src/current/testplan.ts +++ /dev/null @@ -1,31 +0,0 @@ -import fs from "fs"; - -export interface TestPlanV1 { - version: "1.0"; - tests: { - id: string | number; - selector: string; - }[]; -} - -export const parseTestPlan = (): TestPlanV1 | undefined => { - const testPlanPath = process.env.ALLURE_TESTPLAN_PATH; - - if (!testPlanPath) { - return undefined; - } - - try { - const file = fs.readFileSync(testPlanPath, "utf8"); - const testPlan = JSON.parse(file) as TestPlanV1; - - // Execute all tests if test plan is empty - if ((testPlan.tests || []).length === 0) { - return undefined; - } - - return testPlan; - } catch (e) { - return undefined; - } -}; diff --git a/packages/allure-js-commons/src/current/utils.ts b/packages/allure-js-commons/src/current/utils.ts deleted file mode 100644 index b2ead9601..000000000 --- a/packages/allure-js-commons/src/current/utils.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { createHash } from "crypto"; -import { readFile } from "fs/promises"; -import path from "path"; -import { env } from "process"; -import { ExecutableItem, Label, LabelName, Status } from "./model.js"; - -export const md5 = (data: string) => createHash("md5").update(data).digest("hex"); - -export const getLabelsFromEnv = (): Label[] => { - const envKeys = Object.keys(env); - const labels: Label[] = []; - - envKeys.forEach((key) => { - const labelRegexp = /^ALLURE_LABEL_(?.+)$/; - const match = key.match(labelRegexp); - if (match) { - const labelName = match.groups?.labelName; - const envValue = process.env[key]; - if (labelName && envValue) { - labels.push({ name: labelName.toLocaleLowerCase(), value: envValue }); - } - } - }); - - return labels; -}; - -const reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - -export const escapeRegExp = (value: string): string => { - return reHasRegExpChar.test(value) ? value.replace(reRegExpChar, "\\$&") : value; -}; - -export const isAnyStepFailed = (item: ExecutableItem): boolean => { - const isFailed = item.status === Status.FAILED; - - if (isFailed || item.steps.length === 0) { - return isFailed; - } - - return !!item.steps.find((step) => isAnyStepFailed(step)); -}; - -export const isAllStepsEnded = (item: ExecutableItem): boolean => { - return item.steps.every((val) => val.stop && isAllStepsEnded(val)); -}; - -export const readImageAsBase64 = async (filePath: string): Promise => { - try { - const file = await readFile(filePath, { encoding: "base64" }); - return file ? `data:image/png;base64,${file}` : undefined; - } catch (e) { - return undefined; - } -}; - -const asciiRegex = new RegExp( - "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))", // eslint-disable-line no-control-regex - "g", -); - -export const stripAscii = (str: string): string => { - return str.replace(asciiRegex, ""); -}; - -export const allureReportFolder = (outputFolder?: string): string => { - if (process.env.ALLURE_RESULTS_DIR) { - return path.resolve(process.cwd(), process.env.ALLURE_RESULTS_DIR); - } - if (outputFolder) { - return outputFolder; - } - return defaultReportFolder(); -}; - -export const defaultReportFolder = (): string => { - return path.resolve(process.cwd(), "allure-results"); -}; - -export const allureIdRegexp = /@?allure.id[:=](?[^\s]+)/; -export const allureIdRegexpGlobal = new RegExp(allureIdRegexp, "g"); - -export const allureLabelRegexp = /@?allure.label.(?[^\s]+?)[:=](?[^\s]+)/; -export const allureLabelRegexpGlobal = new RegExp(allureLabelRegexp, "g"); - -export const getStatusFromError = (error: Error): Status => { - switch (true) { - /** - * Native `node:assert` and `chai` (`vitest` uses it under the hood) throw `AssertionError` - * `jest` throws `JestAssertionError` instance - * `jasmine` throws `ExpectationFailed` instance - */ - case /assert/gi.test(error.constructor.name): - case /expectation/gi.test(error.constructor.name): - case /assert/gi.test(error.name): - case /assert/gi.test(error.message): - return Status.FAILED; - default: - return Status.BROKEN; - } -}; - -export const getSuitesLabels = (suites: string[]): Label[] => { - if (suites.length === 0) { - return []; - } - - const [parentSuite, suite, ...subSuites] = suites; - const labels: Label[] = []; - - if (parentSuite) { - labels.push({ - name: LabelName.PARENT_SUITE, - value: parentSuite, - }); - } - - if (suite) { - labels.push({ - name: LabelName.SUITE, - value: suite, - }); - } - - if (subSuites.length > 0) { - labels.push({ - name: LabelName.SUB_SUITE, - value: subSuites.join(" > "), - }); - } - - return labels; -}; - -export const serialize = (val: unknown): string => { - if (typeof val === "object" && !(val instanceof Map || val instanceof Set)) { - return JSON.stringify(val); - } - - if (val === undefined) { - return "undefined"; - } - - return (val as any).toString(); -}; - -export const extractMetadataFromString = (title: string): { labels: Label[]; cleanTitle: string } => { - const labels = [] as Label[]; - - title.split(" ").forEach((val) => { - const idValue = val.match(allureIdRegexp)?.groups?.id; - - if (idValue) { - labels.push({ name: LabelName.ALLURE_ID, value: idValue }); - } - - const labelMatch = val.match(allureLabelRegexp); - const { name, value } = labelMatch?.groups || {}; - - if (name && value) { - labels?.push({ name, value }); - } - }); - - const cleanTitle = title.replace(allureLabelRegexpGlobal, "").replace(allureIdRegexpGlobal, "").trim(); - - return { labels, cleanTitle }; -}; diff --git a/packages/allure-js-commons/src/current/writers/AllureWriter.ts b/packages/allure-js-commons/src/current/writers/AllureWriter.ts deleted file mode 100644 index 7253698d4..000000000 --- a/packages/allure-js-commons/src/current/writers/AllureWriter.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PathLike } from "fs"; -import { Category, TestResult, TestResultContainer } from "../model.js"; - -export interface AllureWriter { - writeResult(result: TestResult): void; - - writeGroup(result: TestResultContainer): void; - - writeAttachment(name: string, content: Buffer | string, encoding?: BufferEncoding): void; - - writeAttachmentFromPath(from: PathLike, distFileName: string): void; - - writeEnvironmentInfo(info: Record): void; - - writeCategoriesDefinitions(categories: Category[]): void; -} diff --git a/packages/allure-js-commons/src/current/writers/FileSystemAllureWriter.ts b/packages/allure-js-commons/src/current/writers/FileSystemAllureWriter.ts deleted file mode 100644 index b272513d4..000000000 --- a/packages/allure-js-commons/src/current/writers/FileSystemAllureWriter.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { PathLike, copyFileSync, existsSync, mkdirSync, writeFileSync } from "fs"; -import { join } from "path"; -import properties from "properties"; -import { AllureConfig } from "../AllureConfig.js"; -import { Category, TestResult, TestResultContainer } from "../model.js"; -import { AllureWriter } from "./AllureWriter.js"; - -const writeJson = (path: string, data: unknown): void => { - writeFileSync(path, JSON.stringify(data), { encoding: "utf-8" }); -}; - -export class FileSystemAllureWriter implements AllureWriter { - constructor(private config: AllureConfig) { - if (!existsSync(this.config.resultsDir)) { - mkdirSync(this.config.resultsDir, { - recursive: true, - }); - } - } - - writeAttachment(name: string, content: Buffer | string, encoding: BufferEncoding = "utf-8"): void { - const path = this.buildPath(name); - writeFileSync(path, content, { encoding }); - } - - writeAttachmentFromPath(from: PathLike, distFileName: string): void { - const to = this.buildPath(distFileName); - copyFileSync(from, to); - } - - writeEnvironmentInfo(info?: Record): void { - const text = properties.stringify(info, { unicode: true }).toString(); - const path = this.buildPath("environment.properties"); - - writeFileSync(path, text); - } - - writeCategoriesDefinitions(categories: Category[]): void { - const path = this.buildPath("categories.json"); - writeJson(path, categories); - } - - writeGroup(result: TestResultContainer): void { - const path = this.buildPath(`${result.uuid}-container.json`); - writeJson(path, result); - } - - writeResult(result: TestResult): void { - const path = this.buildPath(`${result.uuid}-result.json`); - writeJson(path, result); - } - - private buildPath(name: string): string { - return join(this.config.resultsDir, name); - } -} diff --git a/packages/allure-js-commons/src/current/writers/InMemoryAllureWriter.ts b/packages/allure-js-commons/src/current/writers/InMemoryAllureWriter.ts deleted file mode 100644 index 1cb3b67c4..000000000 --- a/packages/allure-js-commons/src/current/writers/InMemoryAllureWriter.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { PathLike, readFileSync } from "fs"; -import { Category, TestResult, TestResultContainer } from "../model.js"; -import { AllureWriter } from "./AllureWriter.js"; - -export interface AllureResults { - tests: TestResult[]; - groups: TestResultContainer[]; - attachments: Record; - envInfo?: Record; - categories?: Category[]; -} - -export class InMemoryAllureWriter implements AllureWriter, AllureResults { - public groups: TestResultContainer[] = []; - public tests: TestResult[] = []; - public attachments: Record = {}; - public categories?: Category[]; - public envInfo?: Record; - - public writeGroup(result: TestResultContainer): void { - this.groups.push(result); - } - - public writeResult(result: TestResult): void { - this.tests.push(result); - } - - public writeAttachment(name: string, content: Buffer | string): void { - this.attachments[name] = content; - } - - public writeAttachmentFromPath(from: PathLike, toFileName: string): void { - this.attachments[toFileName] = readFileSync(from); - } - - public writeCategoriesDefinitions(categories: Category[]): void { - if (this.categories) { - // eslint-disable-next-line no-console - console.warn("overwriting existing categories"); - } - this.categories = categories; - } - - public writeEnvironmentInfo(envInfo?: Record): void { - if (this.envInfo) { - // eslint-disable-next-line no-console - console.warn("overwriting existing environment info"); - } - this.envInfo = envInfo; - } - - public reset(): void { - this.groups = []; - this.tests = []; - this.attachments = {}; - } - - public getMaybeTestByName(name: string): TestResult | undefined { - return this.tests.find((t) => t.name === name); - } - - public getTestByName(name: string): TestResult { - const res: TestResult | undefined = this.getMaybeTestByName(name); - if (!res) { - throw new Error(`Test not found: ${name}`); - } - return res; - } - - public getMaybeGroupByName(name: string): TestResultContainer | undefined { - return this.groups.find((g) => g.name === name); - } - - public getGroupByName(name: string): TestResultContainer { - const res: TestResultContainer | undefined = this.getMaybeGroupByName(name); - if (!res) { - throw new Error(`Group not found: ${name}`); - } - return res; - } -} diff --git a/packages/allure-js-commons/src/current/writers/MessageAllureWriter.ts b/packages/allure-js-commons/src/current/writers/MessageAllureWriter.ts deleted file mode 100644 index 58578dc94..000000000 --- a/packages/allure-js-commons/src/current/writers/MessageAllureWriter.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { PathLike, readFileSync } from "fs"; -import properties from "properties"; -import { Category, TestResult, TestResultContainer } from "../model.js"; -import { AllureWriter } from "./AllureWriter.js"; - -type EventType = "result" | "container" | "attachment" | "misc"; -type Event = { - path: string; - type: EventType; - data: string; -}; - -const sendEvent = (event: Event): void => { - process.send?.(JSON.stringify(event)); -}; - -const sendData = (path: string, type: EventType, data: Buffer): void => { - sendEvent({ path, type, data: data.toString("base64") }); -}; - -const writeJson = (path: string, type: EventType, data: any): void => { - sendData(path, type, Buffer.from(JSON.stringify(data))); -}; - -export class MessageAllureWriter implements AllureWriter { - writeAttachment(name: string, content: Buffer | string, encoding: BufferEncoding = "utf-8"): void { - sendData(name, "attachment", typeof content === "string" ? Buffer.from(content, encoding) : content); - } - - writeAttachmentFromPath(from: PathLike, distFileName: string): void { - sendData(distFileName, "attachment", readFileSync(from)); - } - - writeEnvironmentInfo(info?: Record): void { - const text = properties.stringify(info, { unicode: true }).toString(); - sendData("environment.properties", "misc", Buffer.from(text)); - } - - writeCategoriesDefinitions(categories: Category[]): void { - writeJson("categories.json", "misc", categories); - } - - writeGroup(result: TestResultContainer): void { - writeJson(`${result.uuid}-container.json`, "container", result); - } - - writeResult(result: TestResult): void { - writeJson(`${result.uuid}-result.json`, "result", result); - } -} diff --git a/packages/allure-js-commons/src/current/writers/index.ts b/packages/allure-js-commons/src/current/writers/index.ts deleted file mode 100644 index 506dddc92..000000000 --- a/packages/allure-js-commons/src/current/writers/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { AllureWriter } from "./AllureWriter.js"; -export { FileSystemAllureWriter } from "./FileSystemAllureWriter.js"; -export { InMemoryAllureWriter } from "./InMemoryAllureWriter.js"; -export { MessageAllureWriter } from "./MessageAllureWriter.js"; -export { AllureResults } from "./InMemoryAllureWriter.js"; -export * from "./utils.js"; diff --git a/packages/allure-js-commons/src/current/writers/utils.ts b/packages/allure-js-commons/src/current/writers/utils.ts deleted file mode 100644 index 1a285f6d3..000000000 --- a/packages/allure-js-commons/src/current/writers/utils.ts +++ /dev/null @@ -1,907 +0,0 @@ -/* eslint-disable max-lines */ -import { AttachmentOptions } from "../model.js"; - -const extensionsByType: Record = { - "application/andrew-inset": ".ez", - "application/applixware": ".aw", - "application/atom+xml": ".atom", - "application/atomcat+xml": ".atomcat", - "application/atomsvc+xml": ".atomsvc", - "application/bizagi-modeler": ".bpm", - "application/cbor": ".cbor", - "application/ccxml+xml": ".ccxml", - "application/coreldraw": ".cdr", - "application/cu-seeme": ".cu", - "application/dash+xml": ".mpd", - "application/davmount+xml": ".davmount", - "application/dif+xml": ".dif", - "application/dita+xml; format=map": ".ditamap", - "application/dita+xml; format=topic": ".dita", - "application/dita+xml; format=val": ".ditaval", - "application/ecmascript": ".ecma", - "application/emma+xml": ".emma", - "application/envi.hdr": ".hdr", - "application/epub+zip": ".epub", - "application/fits": ".fits", - "application/font-tdpfr": ".pfr", - "application/gzip": ".gz", - "application/hyperstudio": ".stk", - "application/illustrator": ".ai", - "application/java-archive": ".jar", - "application/java-serialized-object": ".ser", - "application/java-vm": ".class", - "application/javascript": ".js", - "application/json": ".json", - "application/lost+xml": ".lostxml", - "application/mac-binhex40": ".hqx", - "application/mac-compactpro": ".cpt", - "application/manifest+json": ".webmanifest", - "application/marc": ".mrc", - "application/mathematica": ".ma", - "application/mathml+xml": ".mathml", - "application/mbox": ".mbox", - "application/mediaservercontrol+xml": ".mscml", - "application/mp4": ".mp4s", - "application/msword": ".doc", - "application/mxf": ".mxf", - "application/octet-stream": ".bin", - "application/oda": ".oda", - "application/oebps-package+xml": ".opf", - "application/ogg": ".ogx", - "application/onenote": ".onetmp", - "application/onenote; format=one": ".one", - "application/onenote; format=onetoc2": ".onetoc", - "application/onenote; format=package": ".onepkg", - "application/patch-ops-error+xml": ".xer", - "application/pdf": ".pdf", - "application/pgp-encrypted": ".pgp", - "application/pgp-signature": ".asc", - "application/pics-rules": ".prf", - "application/pkcs7-mime": ".p7m", - "application/pkcs7-signature": ".p7s", - "application/pkcs10": ".p10", - "application/pkix-cert": ".cer", - "application/pkix-crl": ".crl", - "application/pkix-pkipath": ".pkipath", - "application/pkixcmp": ".pki", - "application/pls+xml": ".pls", - "application/postscript": ".ps", - "application/prs.cww": ".cww", - "application/rdf+xml": ".rdf", - "application/reginfo+xml": ".rif", - "application/relax-ng-compact-syntax": ".rnc", - "application/resource-lists+xml": ".rl", - "application/resource-lists-diff+xml": ".rld", - "application/rls-services+xml": ".rs", - "application/rsd+xml": ".rsd", - "application/rss+xml": ".rss", - "application/rtf": ".rtf", - "application/sbml+xml": ".sbml", - "application/scvp-cv-request": ".scq", - "application/scvp-cv-response": ".scs", - "application/scvp-vp-request": ".spq", - "application/scvp-vp-response": ".spp", - "application/sdp": ".sdp", - "application/sereal": ".srl", - "application/set-payment-initiation": ".setpay", - "application/set-registration-initiation": ".setreg", - "application/shf+xml": ".shf", - "application/sldworks": ".sldprt", - "application/smil+xml": ".smi", - "application/sparql-query": ".rq", - "application/sparql-results+xml": ".srx", - "application/srgs": ".gram", - "application/srgs+xml": ".grxml", - "application/ssml+xml": ".ssml", - "application/timestamped-data": ".tsd", - "application/vnd.3gpp.pic-bw-large": ".plb", - "application/vnd.3gpp.pic-bw-small": ".psb", - "application/vnd.3gpp.pic-bw-var": ".pvb", - "application/vnd.3gpp2.tcap": ".tcap", - "application/vnd.3m.post-it-notes": ".pwn", - "application/vnd.accpac.simply.aso": ".aso", - "application/vnd.accpac.simply.imp": ".imp", - "application/vnd.acucobol": ".acu", - "application/vnd.acucorp": ".atc", - "application/vnd.adobe.aftereffects.project": ".aep", - "application/vnd.adobe.aftereffects.template": ".aet", - "application/vnd.adobe.air-application-installer-package+zip": ".air", - "application/vnd.adobe.indesign-idml-package": ".idml", - "application/vnd.adobe.xdp+xml": ".xdp", - "application/vnd.adobe.xfdf": ".xfdf", - "application/vnd.airzip.filesecure.azf": ".azf", - "application/vnd.airzip.filesecure.azs": ".azs", - "application/vnd.allure.image.diff": ".imagediff", - "application/vnd.allure.metadata+json": ".metadata", - "application/vnd.amazon.ebook": ".azw", - "application/vnd.americandynamics.acc": ".acc", - "application/vnd.amiga.ami": ".ami", - "application/vnd.android.package-archive": ".apk", - "application/vnd.anser-web-certificate-issue-initiation": ".cii", - "application/vnd.anser-web-funds-transfer-initiation": ".fti", - "application/vnd.antix.game-component": ".atx", - "application/vnd.apple.installer+xml": ".mpkg", - "application/vnd.apple.keynote": ".key", - "application/vnd.apple.mpegurl": ".m3u8", - "application/vnd.apple.numbers": ".numbers", - "application/vnd.apple.pages": ".pages", - "application/vnd.arastra.swi": ".swi", - "application/vnd.blueice.multipass": ".mpm", - "application/vnd.bmi": ".bmi", - "application/vnd.businessobjects": ".rep", - "application/vnd.chemdraw+xml": ".cdxml", - "application/vnd.chipnuts.karaoke-mmd": ".mmd", - "application/vnd.cinderella": ".cdy", - "application/vnd.claymore": ".cla", - "application/vnd.clonk.c4group": ".c4g", - "application/vnd.commonspace": ".csp", - "application/vnd.contact.cmsg": ".cdbcmsg", - "application/vnd.cosmocaller": ".cmc", - "application/vnd.crick.clicker": ".clkx", - "application/vnd.crick.clicker.keyboard": ".clkk", - "application/vnd.crick.clicker.palette": ".clkp", - "application/vnd.crick.clicker.template": ".clkt", - "application/vnd.crick.clicker.wordbank": ".clkw", - "application/vnd.criticaltools.wbs+xml": ".wbs", - "application/vnd.ctc-posml": ".pml", - "application/vnd.cups-ppd": ".ppd", - "application/vnd.curl.car": ".car", - "application/vnd.curl.pcurl": ".pcurl", - "application/vnd.data-vision.rdz": ".rdz", - "application/vnd.denovo.fcselayout-link": ".fe_launch", - "application/vnd.dna": ".dna", - "application/vnd.dolby.mlp": ".mlp", - "application/vnd.dpgraph": ".dpg", - "application/vnd.dreamfactory": ".dfac", - "application/vnd.dynageo": ".geo", - "application/vnd.ecowin.chart": ".mag", - "application/vnd.enliven": ".nml", - "application/vnd.epson.esf": ".esf", - "application/vnd.epson.msf": ".msf", - "application/vnd.epson.quickanime": ".qam", - "application/vnd.epson.salt": ".slt", - "application/vnd.epson.ssf": ".ssf", - "application/vnd.eszigno3+xml": ".es3", - "application/vnd.etsi.asic-e+zip": ".asice", - "application/vnd.etsi.asic-s+zip": ".asics", - "application/vnd.ezpix-album": ".ez2", - "application/vnd.ezpix-package": ".ez3", - "application/vnd.fdf": ".fdf", - "application/vnd.fdsn.mseed": ".mseed", - "application/vnd.fdsn.seed": ".seed", - "application/vnd.flographit": ".gph", - "application/vnd.fluxtime.clip": ".ftc", - "application/vnd.framemaker": ".fm", - "application/vnd.frogans.fnc": ".fnc", - "application/vnd.frogans.ltf": ".ltf", - "application/vnd.fsc.weblaunch": ".fsc", - "application/vnd.fujitsu.oasys": ".oas", - "application/vnd.fujitsu.oasys2": ".oa2", - "application/vnd.fujitsu.oasys3": ".oa3", - "application/vnd.fujitsu.oasysgp": ".fg5", - "application/vnd.fujitsu.oasysprs": ".bh2", - "application/vnd.fujixerox.ddd": ".ddd", - "application/vnd.fujixerox.docuworks": ".xdw", - "application/vnd.fujixerox.docuworks.binder": ".xbd", - "application/vnd.fuzzysheet": ".fzs", - "application/vnd.genomatix.tuxedo": ".txd", - "application/vnd.geogebra.file": ".ggb", - "application/vnd.geogebra.tool": ".ggt", - "application/vnd.geometry-explorer": ".gex", - "application/vnd.gmx": ".gmx", - "application/vnd.google-earth.kml+xml": ".kml", - "application/vnd.google-earth.kmz": ".kmz", - "application/vnd.grafeq": ".gqf", - "application/vnd.groove-account": ".gac", - "application/vnd.groove-help": ".ghf", - "application/vnd.groove-identity-message": ".gim", - "application/vnd.groove-injector": ".grv", - "application/vnd.groove-tool-message": ".gtm", - "application/vnd.groove-tool-template": ".tpl", - "application/vnd.groove-vcard": ".vcg", - "application/vnd.handheld-entertainment+xml": ".zmm", - "application/vnd.hbci": ".hbci", - "application/vnd.hhe.lesson-player": ".les", - "application/vnd.hp-hpgl": ".hpgl", - "application/vnd.hp-hpid": ".hpid", - "application/vnd.hp-hps": ".hps", - "application/vnd.hp-jlyt": ".jlt", - "application/vnd.hp-pcl": ".pcl", - "application/vnd.hp-pclxl": ".pclxl", - "application/vnd.hydrostatix.sof-data": ".sfd-hdstx", - "application/vnd.hzn-3d-crossword": ".x3d", - "application/vnd.ibm.minipay": ".mpy", - "application/vnd.ibm.modcap": ".afp", - "application/vnd.ibm.rights-management": ".irm", - "application/vnd.ibm.secure-container": ".sc", - "application/vnd.iccprofile": ".icc", - "application/vnd.igloader": ".igl", - "application/vnd.immervision-ivp": ".ivp", - "application/vnd.immervision-ivu": ".ivu", - "application/vnd.intercon.formnet": ".xpw", - "application/vnd.intu.qbo": ".qbo", - "application/vnd.intu.qfx": ".qfx", - "application/vnd.iptc.g2.newsmessage+xml": ".nar", - "application/vnd.ipunplugged.rcprofile": ".rcprofile", - "application/vnd.irepository.package+xml": ".irp", - "application/vnd.is-xpr": ".xpr", - "application/vnd.jam": ".jam", - "application/vnd.java.hprof": ".hprof", - "application/vnd.java.hprof.text": ".hprof.txt", - "application/vnd.jcp.javame.midlet-rms": ".rms", - "application/vnd.jisp": ".jisp", - "application/vnd.joost.joda-archive": ".joda", - "application/vnd.kahootz": ".ktz", - "application/vnd.kde.karbon": ".karbon", - "application/vnd.kde.kchart": ".chrt", - "application/vnd.kde.kformula": ".kfo", - "application/vnd.kde.kivio": ".flw", - "application/vnd.kde.kontour": ".kon", - "application/vnd.kde.kpresenter": ".kpr", - "application/vnd.kde.kspread": ".ksp", - "application/vnd.kde.kword": ".kwd", - "application/vnd.kenameaapp": ".htke", - "application/vnd.kidspiration": ".kia", - "application/vnd.kinar": ".kne", - "application/vnd.koan": ".skp", - "application/vnd.kodak-descriptor": ".sse", - "application/vnd.llamagraphics.life-balance.desktop": ".lbd", - "application/vnd.llamagraphics.life-balance.exchange+xml": ".lbe", - "application/vnd.lotus-1-2-3": ".wk1", - "application/vnd.lotus-1-2-3; version=2": ".wk1", - "application/vnd.lotus-1-2-3; version=3": ".wk3", - "application/vnd.lotus-1-2-3; version=4": ".wk4", - "application/vnd.lotus-1-2-3; version=97+9.x": ".123", - "application/vnd.lotus-approach": ".apr", - "application/vnd.lotus-freelance": ".pre", - "application/vnd.lotus-notes": ".nsf", - "application/vnd.lotus-organizer": ".org", - "application/vnd.lotus-wordpro": ".lwp", - "application/vnd.macports.portpkg": ".portpkg", - "application/vnd.mcd": ".mcd", - "application/vnd.medcalcdata": ".mc1", - "application/vnd.mediastation.cdkey": ".cdkey", - "application/vnd.mfer": ".mwf", - "application/vnd.mfmp": ".mfm", - "application/vnd.micrografx.flo": ".flo", - "application/vnd.micrografx.igx": ".igx", - "application/vnd.mif": ".mif", - "application/vnd.mindjet.mindmanager": ".mmp", - "application/vnd.mobius.daf": ".daf", - "application/vnd.mobius.dis": ".dis", - "application/vnd.mobius.mbk": ".mbk", - "application/vnd.mobius.mqy": ".mqy", - "application/vnd.mobius.msl": ".msl", - "application/vnd.mobius.plc": ".plc", - "application/vnd.mobius.txf": ".txf", - "application/vnd.mophun.application": ".mpn", - "application/vnd.mophun.certificate": ".mpc", - "application/vnd.mozilla.xul+xml": ".xul", - "application/vnd.ms-artgalry": ".cil", - "application/vnd.ms-cab-compressed": ".cab", - "application/vnd.ms-excel": ".xls", - "application/vnd.ms-excel.addin.macroenabled.12": ".xlam", - "application/vnd.ms-excel.sheet.binary.macroenabled.12": ".xlsb", - "application/vnd.ms-excel.sheet.macroenabled.12": ".xlsm", - "application/vnd.ms-excel.template.macroenabled.12": ".xltm", - "application/vnd.ms-fontobject": ".eot", - "application/vnd.ms-htmlhelp": ".chm", - "application/vnd.ms-ims": ".ims", - "application/vnd.ms-lrm": ".lrm", - "application/vnd.ms-outlook": ".msg", - "application/vnd.ms-outlook-pst": ".pst", - "application/vnd.ms-pki.seccat": ".cat", - "application/vnd.ms-pki.stl": ".stl", - "application/vnd.ms-powerpoint": ".ppt", - "application/vnd.ms-powerpoint.addin.macroenabled.12": ".ppam", - "application/vnd.ms-powerpoint.presentation.macroenabled.12": ".pptm", - "application/vnd.ms-powerpoint.slide.macroenabled.12": ".sldm", - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ".ppsm", - "application/vnd.ms-powerpoint.template.macroenabled.12": ".potm", - "application/vnd.ms-project": ".mpp", - "application/vnd.ms-visio.drawing": ".vsdx", - "application/vnd.ms-visio.drawing.macroenabled.12": ".vsdm", - "application/vnd.ms-visio.stencil": ".vssx", - "application/vnd.ms-visio.stencil.macroenabled.12": ".vssm", - "application/vnd.ms-visio.template": ".vstx", - "application/vnd.ms-visio.template.macroenabled.12": ".vstm", - "application/vnd.ms-word.document.macroenabled.12": ".docm", - "application/vnd.ms-word.template.macroenabled.12": ".dotm", - "application/vnd.ms-works": ".wps", - "application/vnd.ms-wpl": ".wpl", - "application/vnd.ms-xpsdocument": ".xps", - "application/vnd.mseq": ".mseq", - "application/vnd.musician": ".mus", - "application/vnd.muvee.style": ".msty", - "application/vnd.neurolanguage.nlu": ".nlu", - "application/vnd.noblenet-directory": ".nnd", - "application/vnd.noblenet-sealer": ".nns", - "application/vnd.noblenet-web": ".nnw", - "application/vnd.nokia.n-gage.data": ".ngdat", - "application/vnd.nokia.n-gage.symbian.install": ".n-gage", - "application/vnd.nokia.radio-preset": ".rpst", - "application/vnd.nokia.radio-presets": ".rpss", - "application/vnd.novadigm.edm": ".edm", - "application/vnd.novadigm.edx": ".edx", - "application/vnd.novadigm.ext": ".ext", - "application/vnd.oasis.opendocument.base": ".odb", - "application/vnd.oasis.opendocument.chart": ".odc", - "application/vnd.oasis.opendocument.chart-template": ".otc", - "application/vnd.oasis.opendocument.flat.presentation": ".fodp", - "application/vnd.oasis.opendocument.flat.spreadsheet": ".fods", - "application/vnd.oasis.opendocument.flat.text": ".fodt", - "application/vnd.oasis.opendocument.formula": ".odf", - "application/vnd.oasis.opendocument.formula-template": ".odft", - "application/vnd.oasis.opendocument.graphics": ".odg", - "application/vnd.oasis.opendocument.graphics-template": ".otg", - "application/vnd.oasis.opendocument.image": ".odi", - "application/vnd.oasis.opendocument.image-template": ".oti", - "application/vnd.oasis.opendocument.presentation": ".odp", - "application/vnd.oasis.opendocument.presentation-template": ".otp", - "application/vnd.oasis.opendocument.spreadsheet": ".ods", - "application/vnd.oasis.opendocument.spreadsheet-template": ".ots", - "application/vnd.oasis.opendocument.text": ".odt", - "application/vnd.oasis.opendocument.text-master": ".otm", - "application/vnd.oasis.opendocument.text-template": ".ott", - "application/vnd.oasis.opendocument.text-web": ".oth", - "application/vnd.olpc-sugar": ".xo", - "application/vnd.oma.dd2+xml": ".dd2", - "application/vnd.openofficeorg.autotext": ".bau", - "application/vnd.openofficeorg.extension": ".oxt", - "application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx", - "application/vnd.openxmlformats-officedocument.presentationml.slide": ".sldx", - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ".ppsx", - "application/vnd.openxmlformats-officedocument.presentationml.template": ".potx", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx", - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ".xltx", - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx", - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ".dotx", - "application/vnd.osgi.dp": ".dp", - "application/vnd.palm": ".pqa", - "application/vnd.pg.format": ".str", - "application/vnd.pg.osasli": ".ei6", - "application/vnd.picsel": ".efif", - "application/vnd.pocketlearn": ".plf", - "application/vnd.powerbuilder6": ".pbd", - "application/vnd.previewsystems.box": ".box", - "application/vnd.proteus.magazine": ".mgz", - "application/vnd.publishare-delta-tree": ".qps", - "application/vnd.pvi.ptid1": ".ptid", - "application/vnd.quark.quarkxpress": ".qxd", - "application/vnd.recordare.musicxml": ".mxl", - "application/vnd.recordare.musicxml+xml": ".musicxml", - "application/vnd.rim.cod": ".cod", - "application/vnd.rn-realmedia": ".rm", - "application/vnd.route66.link66+xml": ".link66", - "application/vnd.seemail": ".see", - "application/vnd.sema": ".sema", - "application/vnd.semd": ".semd", - "application/vnd.semf": ".semf", - "application/vnd.shana.informed.formdata": ".ifm", - "application/vnd.shana.informed.formtemplate": ".itp", - "application/vnd.shana.informed.interchange": ".iif", - "application/vnd.shana.informed.package": ".ipk", - "application/vnd.simtech-mindmapper": ".twd", - "application/vnd.smaf": ".mmf", - "application/vnd.smart.teacher": ".teacher", - "application/vnd.solent.sdkm+xml": ".sdkm", - "application/vnd.spotfire.dxp": ".dxp", - "application/vnd.spotfire.sfs": ".sfs", - "application/vnd.stardivision.calc": ".sdc", - "application/vnd.stardivision.draw": ".sda", - "application/vnd.stardivision.impress": ".sdd", - "application/vnd.stardivision.math": ".smf", - "application/vnd.stardivision.writer": ".sdw", - "application/vnd.stardivision.writer-global": ".sgl", - "application/vnd.sun.xml.calc": ".sxc", - "application/vnd.sun.xml.calc.template": ".stc", - "application/vnd.sun.xml.draw": ".sxd", - "application/vnd.sun.xml.draw.template": ".std", - "application/vnd.sun.xml.impress": ".sxi", - "application/vnd.sun.xml.impress.template": ".sti", - "application/vnd.sun.xml.math": ".sxm", - "application/vnd.sun.xml.writer": ".sxw", - "application/vnd.sun.xml.writer.global": ".sxg", - "application/vnd.sun.xml.writer.template": ".stw", - "application/vnd.sus-calendar": ".sus", - "application/vnd.svd": ".svd", - "application/vnd.symbian.install": ".sis", - "application/vnd.syncml+xml": ".xsm", - "application/vnd.syncml.dm+wbxml": ".bdm", - "application/vnd.syncml.dm+xml": ".xdm", - "application/vnd.tao.intent-module-archive": ".tao", - "application/vnd.tcpdump.pcap": ".pcap", - "application/vnd.tmobile-livetv": ".tmo", - "application/vnd.trid.tpt": ".tpt", - "application/vnd.triscape.mxs": ".mxs", - "application/vnd.trueapp": ".tra", - "application/vnd.ufdl": ".ufd", - "application/vnd.uiq.theme": ".utz", - "application/vnd.umajin": ".umj", - "application/vnd.unity": ".unityweb", - "application/vnd.uoml+xml": ".uoml", - "application/vnd.vcx": ".vcx", - "application/vnd.visio": ".vsd", - "application/vnd.visionary": ".vis", - "application/vnd.vsf": ".vsf", - "application/vnd.wap.wbxml": ".wbxml", - "application/vnd.wap.wmlc": ".wmlc", - "application/vnd.wap.wmlscriptc": ".wmlsc", - "application/vnd.webturbo": ".wtb", - "application/vnd.wolfram.wl": ".wl", - "application/vnd.wordperfect": ".wpd", - "application/vnd.wqd": ".wqd", - "application/vnd.wt.stf": ".stf", - "application/vnd.xara": ".xar", - "application/vnd.xfdl": ".xfdl", - "application/vnd.yamaha.hv-dic": ".hvd", - "application/vnd.yamaha.hv-script": ".hvs", - "application/vnd.yamaha.hv-voice": ".hvp", - "application/vnd.yamaha.openscoreformat": ".osf", - "application/vnd.yamaha.openscoreformat.osfpvg+xml": ".osfpvg", - "application/vnd.yamaha.smaf-audio": ".saf", - "application/vnd.yamaha.smaf-phrase": ".spf", - "application/vnd.yellowriver-custom-menu": ".cmp", - "application/vnd.zul": ".zir", - "application/vnd.zzazz.deck+xml": ".zaz", - "application/voicexml+xml": ".vxml", - "application/warc": ".warc", - "application/wasm": ".wasm", - "application/winhlp": ".hlp", - "application/wsdl+xml": ".wsdl", - "application/wspolicy+xml": ".wspolicy", - "application/x-7z-compressed": ".7z", - "application/x-abiword": ".abw", - "application/x-ace-compressed": ".ace", - "application/x-adobe-indesign": ".indd", - "application/x-adobe-indesign-interchange": ".inx", - "application/x-apple-diskimage": ".dmg", - "application/x-appleworks": ".cwk", - "application/x-archive": ".ar", - "application/x-arj": ".arj", - "application/x-authorware-bin": ".aab", - "application/x-authorware-map": ".aam", - "application/x-authorware-seg": ".aas", - "application/x-axcrypt": ".axx", - "application/x-bat": ".bat", - "application/x-bcpio": ".bcpio", - "application/x-bibtex-text-file": ".bib", - "application/x-bittorrent": ".torrent", - "application/x-brotli": ".br", - "application/x-bzip": ".bz", - "application/x-bzip2": ".bz2", - "application/x-cdlink": ".vcd", - "application/x-chat": ".chat", - "application/x-chess-pgn": ".pgn", - "application/x-chrome-package": ".crx", - "application/x-compress": ".z", - "application/x-corelpresentations": ".shw", - "application/x-cpio": ".cpio", - "application/x-csh": ".csh", - "application/x-dbf": ".dbf", - "application/x-debian-package": ".deb", - "application/x-dex": ".dex", - "application/x-director": ".dir", - "application/x-doom": ".wad", - "application/x-dosexec": ".exe", - "application/x-dtbncx+xml": ".ncx", - "application/x-dtbook+xml": ".dtb", - "application/x-dtbresource+xml": ".res", - "application/x-dvi": ".dvi", - "application/x-elc": ".elc", - "application/x-endnote-refer": ".enw", - "application/x-erdas-hfa": ".hfa", - "application/x-esri-layer": ".lyr", - "application/x-fictionbook+xml": ".fb2", - "application/x-filemaker": ".fp7", - "application/x-font-adobe-metric": ".afm", - "application/x-font-bdf": ".bdf", - "application/x-font-ghostscript": ".gsf", - "application/x-font-linux-psf": ".psf", - "application/x-font-otf": ".otf", - "application/x-font-pcf": ".pcf", - "application/x-font-printer-metric": ".pfm", - "application/x-font-snf": ".snf", - "application/x-font-ttf": ".ttf", - "application/x-font-type1": ".pfa", - "application/x-futuresplash": ".spl", - "application/x-gnucash": ".gnucash", - "application/x-gnumeric": ".gnumeric", - "application/x-grib": ".grb", - "application/x-gtar": ".gtar", - "application/x-hdf": ".hdf", - "application/x-ibooks+zip": ".ibooks", - "application/x-internet-archive": ".arc", - "application/x-iso9660-image": ".iso", - "application/x-itunes-ipa": ".ipa", - "application/x-java-jnilib": ".jnilib", - "application/x-java-jnlp-file": ".jnlp", - "application/x-java-pack200": ".pack", - "application/x-killustrator": ".kil", - "application/x-latex": ".latex", - "application/x-lz4": ".lz4", - "application/x-lzip": ".lz", - "application/x-lzma": ".lzma", - "application/x-matlab-data": ".mat", - "application/x-memgraph": ".memgraph", - "application/x-mobipocket-ebook": ".prc", - "application/x-ms-application": ".application", - "application/x-ms-asx": ".asx", - "application/x-ms-installer": ".msi", - "application/x-ms-wmd": ".wmd", - "application/x-ms-wmz": ".wmz", - "application/x-ms-xbap": ".xbap", - "application/x-msaccess": ".mdb", - "application/x-msbinder": ".obd", - "application/x-mscardfile": ".crd", - "application/x-msclip": ".clp", - "application/x-msdownload": ".dll", - "application/x-msmediaview": ".mvb", - "application/x-msmoney": ".mny", - "application/x-mspublisher": ".pub", - "application/x-msschedule": ".scd", - "application/x-msterminal": ".trm", - "application/x-mswrite": ".wri", - "application/x-mysql-misam-compressed-index": ".MYI", - "application/x-mysql-misam-data": ".MYD", - "application/x-nesrom": ".nes", - "application/x-netcdf": ".nc", - "application/x-parquet": ".parquet", - "application/x-pkcs7-certificates": ".p7b", - "application/x-pkcs7-certreqresp": ".p7r", - "application/x-pkcs12": ".p12", - "application/x-project": ".mpx", - "application/x-prt": ".prt", - "application/x-quattro-pro": ".wq1", - "application/x-quattro-pro; version=1+5": ".wb1", - "application/x-quattro-pro; version=1-4": ".wq1", - "application/x-quattro-pro; version=5": ".wq2", - "application/x-quattro-pro; version=6": ".wb2", - "application/x-rar-compressed": ".rar", - "application/x-roxio-toast": ".toast", - "application/x-rpm": ".rpm", - "application/x-sas": ".sas", - "application/x-sas-access": ".sa7", - "application/x-sas-audit": ".st7", - "application/x-sas-backup": ".sas7bbak", - "application/x-sas-catalog": ".sc7", - "application/x-sas-data": ".sd7", - "application/x-sas-data-index": ".si7", - "application/x-sas-data-v6": ".sd2", - "application/x-sas-dmdb": ".s7m", - "application/x-sas-fdb": ".sf7", - "application/x-sas-itemstor": ".sr7", - "application/x-sas-mddb": ".sm7", - "application/x-sas-program-data": ".ss7", - "application/x-sas-putility": ".sp7", - "application/x-sas-transport": ".stx", - "application/x-sas-utility": ".su7", - "application/x-sas-view": ".sv7", - "application/x-sas-xport": ".xpt", - "application/x-sfdu": ".sfdu", - "application/x-sh": ".sh", - "application/x-shapefile": ".shp", - "application/x-shar": ".shar", - "application/x-shockwave-flash": ".swf", - "application/x-silverlight-app": ".xap", - "application/x-snappy-framed": ".sz", - "application/x-staroffice-template": ".vor", - "application/x-stata-do": ".do", - "application/x-stata-dta": ".dta", - "application/x-stuffit": ".sit", - "application/x-stuffitx": ".sitx", - "application/x-sv4cpio": ".sv4cpio", - "application/x-sv4crc": ".sv4crc", - "application/x-tar": ".tar", - "application/x-tex": ".tex", - "application/x-tex-tfm": ".tfm", - "application/x-texinfo": ".texinfo", - "application/x-tika-java-enterprise-archive": ".ear", - "application/x-tika-java-web-archive": ".war", - "application/x-tika-msworks-spreadsheet": ".xlr", - "application/x-tmx": ".tmx", - "application/x-uc2-compressed": ".uc2", - "application/x-ustar": ".ustar", - "application/x-vmdk": ".vmdk", - "application/x-wais-source": ".src", - "application/x-webarchive": ".webarchive", - "application/x-x509-cert": ".crt", - "application/x-x509-cert; format=der": ".der", - "application/x-x509-cert; format=pem": ".pem", - "application/x-xfig": ".fig", - "application/x-xliff+xml": ".xlf", - "application/x-xliff+zip": ".xlz", - "application/x-xmind": ".xmind", - "application/x-xpinstall": ".xpi", - "application/x-xz": ".xz", - "application/x-zoo": ".zoo", - "application/xenc+xml": ".xenc", - "application/xhtml+xml": ".xhtml", - "application/xml": ".xml", - "application/xml-dtd": ".dtd", - "application/xop+xml": ".xop", - "application/xquery": ".xq", - "application/xslfo+xml": ".xslfo", - "application/xslt+xml": ".xslt", - "application/xspf+xml": ".xspf", - "application/xv+xml": ".mxml", - "application/zip": ".zip", - "application/zstd": ".zst", - "audio/ac3": ".ac3", - "audio/adpcm": ".adp", - "audio/amr": ".amr", - "audio/basic": ".au", - "audio/midi": ".mid", - "audio/mp4": ".mp4a", - "audio/mpeg": ".mpga", - "audio/ogg": ".oga", - "audio/opus": ".opus", - "audio/speex": ".spx", - "audio/vnd.adobe.soundbooth": ".asnd", - "audio/vnd.digital-winds": ".eol", - "audio/vnd.dts": ".dts", - "audio/vnd.dts.hd": ".dtshd", - "audio/vnd.lucent.voice": ".lvp", - "audio/vnd.ms-playready.media.pya": ".pya", - "audio/vnd.nuera.ecelp4800": ".ecelp4800", - "audio/vnd.nuera.ecelp7470": ".ecelp7470", - "audio/vnd.nuera.ecelp9600": ".ecelp9600", - "audio/vnd.wave": ".wav", - "audio/vorbis": ".ogg", - "audio/x-aac": ".aac", - "audio/x-aiff": ".aif", - "audio/x-caf": ".caf", - "audio/x-flac": ".flac", - "audio/x-matroska": ".mka", - "audio/x-mod": ".mod", - "audio/x-mpegurl": ".m3u", - "audio/x-ms-wax": ".wax", - "audio/x-ms-wma": ".wma", - "audio/x-pn-realaudio": ".ram", - "audio/x-pn-realaudio-plugin": ".rmp", - "chemical/x-cdx": ".cdx", - "chemical/x-cif": ".cif", - "chemical/x-cmdf": ".cmdf", - "chemical/x-cml": ".cml", - "chemical/x-csml": ".csml", - "chemical/x-pdb": ".pdb", - "chemical/x-xyz": ".xyz", - "image/aces": ".exr", - "image/avif": ".avif", - "image/bmp": ".bmp", - "image/cgm": ".cgm", - "image/emf": ".emf", - "image/g3fax": ".g3", - "image/gif": ".gif", - "image/heic": ".heic", - "image/heif": ".heif", - "image/icns": ".icns", - "image/ief": ".ief", - "image/jp2": ".jp2", - "image/jpeg": ".jpg", - "image/jpm": ".jpm", - "image/jpx": ".jpf", - "image/jxl": ".jxl", - "image/nitf": ".ntf", - "image/png": ".png", - "image/prs.btif": ".btif", - "image/svg+xml": ".svg", - "image/tiff": ".tiff", - "image/vnd.adobe.photoshop": ".psd", - "image/vnd.adobe.premiere": ".ppj", - "image/vnd.dgn": ".dgn", - "image/vnd.djvu": ".djvu", - "image/vnd.dwg": ".dwg", - "image/vnd.dxb": ".dxb", - "image/vnd.dxf": ".dxf", - "image/vnd.fastbidsheet": ".fbs", - "image/vnd.fpx": ".fpx", - "image/vnd.fst": ".fst", - "image/vnd.fujixerox.edmics-mmr": ".mmr", - "image/vnd.fujixerox.edmics-rlc": ".rlc", - "image/vnd.microsoft.icon": ".ico", - "image/vnd.ms-modi": ".mdi", - "image/vnd.net-fpx": ".npx", - "image/vnd.wap.wbmp": ".wbmp", - "image/vnd.xiff": ".xif", - "image/vnd.zbrush.dcx": ".dcx", - "image/vnd.zbrush.pcx": ".pcx", - "image/webp": ".webp", - "image/wmf": ".wmf", - "image/x-bpg": ".bpg", - "image/x-cmu-raster": ".ras", - "image/x-cmx": ".cmx", - "image/x-dpx": ".dpx", - "image/x-emf-compressed": ".emz", - "image/x-freehand": ".fh", - "image/x-jbig2": ".jb2", - "image/x-jp2-codestream": ".j2c", - "image/x-pict": ".pic", - "image/x-portable-anymap": ".pnm", - "image/x-portable-bitmap": ".pbm", - "image/x-portable-graymap": ".pgm", - "image/x-portable-pixmap": ".ppm", - "image/x-raw-adobe": ".dng", - "image/x-raw-canon": ".crw", - "image/x-raw-casio": ".bay", - "image/x-raw-epson": ".erf", - "image/x-raw-fuji": ".raf", - "image/x-raw-hasselblad": ".3fr", - "image/x-raw-imacon": ".fff", - "image/x-raw-kodak": ".k25", - "image/x-raw-leaf": ".mos", - "image/x-raw-logitech": ".pxn", - "image/x-raw-mamiya": ".mef", - "image/x-raw-minolta": ".mrw", - "image/x-raw-nikon": ".nef", - "image/x-raw-olympus": ".orf", - "image/x-raw-panasonic": ".raw", - "image/x-raw-pentax": ".ptx", - "image/x-raw-phaseone": ".iiq", - "image/x-raw-rawzor": ".rwz", - "image/x-raw-red": ".r3d", - "image/x-raw-sigma": ".x3f", - "image/x-raw-sony": ".arw", - "image/x-rgb": ".rgb", - "image/x-tga": ".tga", - "image/x-xbitmap": ".xbm", - "image/x-xcf": ".xcf", - "image/x-xpixmap": ".xpm", - "image/x-xwindowdump": ".xwd", - "message/rfc822": ".eml", - "message/x-emlx": ".emlx", - "model/e57": ".e57", - "model/iges": ".igs", - "model/mesh": ".msh", - "model/vnd.dwf": ".dwf", - "model/vnd.dwfx+xps": ".dwfx", - "model/vnd.gdl": ".gdl", - "model/vnd.gtw": ".gtw", - "model/vnd.mts": ".mts", - "model/vnd.vtu": ".vtu", - "model/vrml": ".wrl", - "multipart/related": ".mht", - "text/asp": ".asp", - "text/aspdotnet": ".aspx", - "text/calendar": ".ics", - "text/css": ".css", - "text/csv": ".csv", - "text/html": ".html", - "text/iso19139+xml": ".iso19139", - "text/plain": ".txt", - "text/prs.lines.tag": ".dsc", - "text/richtext": ".rtx", - "text/sgml": ".sgml", - "text/tab-separated-values": ".tsv", - "text/troff": ".t", - "text/uri-list": ".uri", - "text/vnd.curl": ".curl", - "text/vnd.curl.dcurl": ".dcurl", - "text/vnd.curl.mcurl": ".mcurl", - "text/vnd.curl.scurl": ".scurl", - "text/vnd.fly": ".fly", - "text/vnd.fmi.flexstor": ".flx", - "text/vnd.graphviz": ".gv", - "text/vnd.in3d.3dml": ".3dml", - "text/vnd.in3d.spot": ".spot", - "text/vnd.iptc.anpa": ".anpa", - "text/vnd.sun.j2me.app-descriptor": ".jad", - "text/vnd.wap.wml": ".wml", - "text/vnd.wap.wmlscript": ".wmls", - "text/vtt": ".vtt", - "text/x-actionscript": ".as", - "text/x-ada": ".ada", - "text/x-applescript": ".applescript", - "text/x-asciidoc": ".asciidoc", - "text/x-aspectj": ".aj", - "text/x-assembly": ".s", - "text/x-awk": ".awk", - "text/x-basic": ".bas", - "text/x-c++hdr": ".hpp", - "text/x-c++src": ".cpp", - "text/x-cgi": ".cgi", - "text/x-chdr": ".h", - "text/x-clojure": ".clj", - "text/x-cobol": ".cbl", - "text/x-coffeescript": ".coffee", - "text/x-coldfusion": ".cfm", - "text/x-common-lisp": ".cl", - "text/x-config": ".config", - "text/x-csharp": ".cs", - "text/x-csrc": ".c", - "text/x-d": ".d", - "text/x-diff": ".diff", - "text/x-eiffel": ".e", - "text/x-emacs-lisp": ".el", - "text/x-erlang": ".erl", - "text/x-expect": ".exp", - "text/x-forth": ".4th", - "text/x-fortran": ".f", - "text/x-go": ".go", - "text/x-groovy": ".groovy", - "text/x-haml": ".haml", - "text/x-haskell": ".hs", - "text/x-haxe": ".hx", - "text/x-idl": ".idl", - "text/x-ini": ".ini", - "text/x-java-properties": ".properties", - "text/x-java-source": ".java", - "text/x-jsp": ".jsp", - "text/x-less": ".less", - "text/x-lex": ".l", - "text/x-log": ".log", - "text/x-lua": ".lua", - "text/x-ml": ".ml", - "text/x-modula": ".m3", - "text/x-objcsrc": ".m", - "text/x-ocaml": ".ocaml", - "text/x-pascal": ".p", - "text/x-perl": ".pl", - "text/x-php": ".php", - "text/x-prolog": ".pro", - "text/x-python": ".py", - "text/x-rexx": ".rexx", - "text/x-rsrc": ".r", - "text/x-rst": ".rest", - "text/x-ruby": ".rb", - "text/x-scala": ".scala", - "text/x-scheme": ".scm", - "text/x-sed": ".sed", - "text/x-setext": ".etx", - "text/x-sql": ".sql", - "text/x-stsrc": ".st", - "text/x-tcl": ".itk", - "text/x-uuencode": ".uu", - "text/x-vbasic": ".cls", - "text/x-vbdotnet": ".vb", - "text/x-vbscript": ".vbs", - "text/x-vcalendar": ".vcs", - "text/x-vcard": ".vcf", - "text/x-verilog": ".v", - "text/x-vhdl": ".vhd", - "text/x-web-markdown": ".md", - "text/x-yacc": ".y", - "text/x-yaml": ".yaml", - "video/3gpp": ".3gp", - "video/3gpp2": ".3g2", - "video/h261": ".h261", - "video/h263": ".h263", - "video/h264": ".h264", - "video/iso.segment": ".m4s", - "video/jpeg": ".jpgv", - "video/mj2": ".mj2", - "video/mp4": ".mp4", - "video/mpeg": ".mpeg", - "video/ogg": ".ogv", - "video/quicktime": ".qt", - "video/vnd.fvt": ".fvt", - "video/vnd.mpegurl": ".mxu", - "video/vnd.ms-playready.media.pyv": ".pyv", - "video/vnd.vivo": ".viv", - "video/webm": ".webm", - "video/x-dirac": ".drc", - "video/x-f4v": ".f4v", - "video/x-flc": ".flc", - "video/x-fli": ".fli", - "video/x-flv": ".flv", - "video/x-jng": ".jng", - "video/x-m4v": ".m4v", - "video/x-matroska": ".mkv", - "video/x-mng": ".mng", - "video/x-ms-asf": ".asf", - "video/x-ms-wm": ".wm", - "video/x-ms-wmv": ".wmv", - "video/x-ms-wmx": ".wmx", - "video/x-ms-wvx": ".wvx", - "video/x-msvideo": ".avi", - "video/x-ogm": ".ogm", - "video/x-sgi-movie": ".movie", - "x-conference/x-cooltalk": ".ice", -}; - -export const typeToExtension = (options: AttachmentOptions): string => { - if (options.fileExtension) { - return options.fileExtension.startsWith(".") ? options.fileExtension : `.${options.fileExtension}`; - } - return extensionsByType[options.contentType] || ""; -}; diff --git a/packages/allure-js-commons/src/new/facade.ts b/packages/allure-js-commons/src/facade.ts similarity index 100% rename from packages/allure-js-commons/src/new/facade.ts rename to packages/allure-js-commons/src/facade.ts diff --git a/packages/allure-js-commons/src/new/index.ts b/packages/allure-js-commons/src/index.ts similarity index 95% rename from packages/allure-js-commons/src/new/index.ts rename to packages/allure-js-commons/src/index.ts index 6268e2c66..890700885 100644 --- a/packages/allure-js-commons/src/new/index.ts +++ b/packages/allure-js-commons/src/index.ts @@ -31,6 +31,7 @@ export { Category, ContentType, EnvironmentInfo, + Executable, ParameterMode, ParameterOptions, Parameter, @@ -44,6 +45,7 @@ export { FixtureResult, TestResultContainer, Attachment, + ImageDiffAttachment, Severity, Stage, Status, @@ -66,4 +68,5 @@ export { isAnyStepFailed, isPromise, Stack, + serialize, } from "./utils.js"; diff --git a/packages/allure-js-commons/src/new/internal.ts b/packages/allure-js-commons/src/internal.ts similarity index 100% rename from packages/allure-js-commons/src/new/internal.ts rename to packages/allure-js-commons/src/internal.ts diff --git a/packages/allure-js-commons/src/new/model.ts b/packages/allure-js-commons/src/model.ts similarity index 100% rename from packages/allure-js-commons/src/new/model.ts rename to packages/allure-js-commons/src/model.ts diff --git a/packages/allure-js-commons/src/new/sdk/Config.ts b/packages/allure-js-commons/src/sdk/Config.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/Config.ts rename to packages/allure-js-commons/src/sdk/Config.ts diff --git a/packages/allure-js-commons/src/new/sdk/Crypto.ts b/packages/allure-js-commons/src/sdk/Crypto.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/Crypto.ts rename to packages/allure-js-commons/src/sdk/Crypto.ts diff --git a/packages/allure-js-commons/src/new/sdk/LifecycleListener.ts b/packages/allure-js-commons/src/sdk/LifecycleListener.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/LifecycleListener.ts rename to packages/allure-js-commons/src/sdk/LifecycleListener.ts diff --git a/packages/allure-js-commons/src/new/sdk/LifecycleState.ts b/packages/allure-js-commons/src/sdk/LifecycleState.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/LifecycleState.ts rename to packages/allure-js-commons/src/sdk/LifecycleState.ts diff --git a/packages/allure-js-commons/src/new/sdk/MessageHolder.ts b/packages/allure-js-commons/src/sdk/MessageHolder.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/MessageHolder.ts rename to packages/allure-js-commons/src/sdk/MessageHolder.ts diff --git a/packages/allure-js-commons/src/new/sdk/ReporterRuntime.ts b/packages/allure-js-commons/src/sdk/ReporterRuntime.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/ReporterRuntime.ts rename to packages/allure-js-commons/src/sdk/ReporterRuntime.ts diff --git a/packages/allure-js-commons/src/new/sdk/TestHolder.ts b/packages/allure-js-commons/src/sdk/TestHolder.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/TestHolder.ts rename to packages/allure-js-commons/src/sdk/TestHolder.ts diff --git a/packages/allure-js-commons/src/new/sdk/TestPlan.ts b/packages/allure-js-commons/src/sdk/TestPlan.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/TestPlan.ts rename to packages/allure-js-commons/src/sdk/TestPlan.ts diff --git a/packages/allure-js-commons/src/new/sdk/Writer.ts b/packages/allure-js-commons/src/sdk/Writer.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/Writer.ts rename to packages/allure-js-commons/src/sdk/Writer.ts diff --git a/packages/allure-js-commons/src/new/sdk/browser/Crypto.ts b/packages/allure-js-commons/src/sdk/browser/Crypto.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/browser/Crypto.ts rename to packages/allure-js-commons/src/sdk/browser/Crypto.ts diff --git a/packages/allure-js-commons/src/new/sdk/browser/ReporterRuntime.ts b/packages/allure-js-commons/src/sdk/browser/ReporterRuntime.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/browser/ReporterRuntime.ts rename to packages/allure-js-commons/src/sdk/browser/ReporterRuntime.ts diff --git a/packages/allure-js-commons/src/new/sdk/browser/index.ts b/packages/allure-js-commons/src/sdk/browser/index.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/browser/index.ts rename to packages/allure-js-commons/src/sdk/browser/index.ts diff --git a/packages/allure-js-commons/src/new/sdk/context/AllureContextProviderBase.ts b/packages/allure-js-commons/src/sdk/context/AllureContextProviderBase.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/context/AllureContextProviderBase.ts rename to packages/allure-js-commons/src/sdk/context/AllureContextProviderBase.ts diff --git a/packages/allure-js-commons/src/new/sdk/context/StaticAllureContextProvider.ts b/packages/allure-js-commons/src/sdk/context/StaticAllureContextProvider.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/context/StaticAllureContextProvider.ts rename to packages/allure-js-commons/src/sdk/context/StaticAllureContextProvider.ts diff --git a/packages/allure-js-commons/src/new/sdk/context/index.ts b/packages/allure-js-commons/src/sdk/context/index.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/context/index.ts rename to packages/allure-js-commons/src/sdk/context/index.ts diff --git a/packages/allure-js-commons/src/new/sdk/context/types.ts b/packages/allure-js-commons/src/sdk/context/types.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/context/types.ts rename to packages/allure-js-commons/src/sdk/context/types.ts diff --git a/packages/allure-js-commons/src/new/sdk/index.ts b/packages/allure-js-commons/src/sdk/index.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/index.ts rename to packages/allure-js-commons/src/sdk/index.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/Crypto.ts b/packages/allure-js-commons/src/sdk/node/Crypto.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/Crypto.ts rename to packages/allure-js-commons/src/sdk/node/Crypto.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/ReporterRuntime.ts b/packages/allure-js-commons/src/sdk/node/ReporterRuntime.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/ReporterRuntime.ts rename to packages/allure-js-commons/src/sdk/node/ReporterRuntime.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/TestPlan.ts b/packages/allure-js-commons/src/sdk/node/TestPlan.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/TestPlan.ts rename to packages/allure-js-commons/src/sdk/node/TestPlan.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/index.ts b/packages/allure-js-commons/src/sdk/node/index.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/index.ts rename to packages/allure-js-commons/src/sdk/node/index.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/utils.ts b/packages/allure-js-commons/src/sdk/node/utils.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/utils.ts rename to packages/allure-js-commons/src/sdk/node/utils.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/writers/FileSystemAllureWriter.ts b/packages/allure-js-commons/src/sdk/node/writers/FileSystemAllureWriter.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/writers/FileSystemAllureWriter.ts rename to packages/allure-js-commons/src/sdk/node/writers/FileSystemAllureWriter.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/writers/InMemoryAllureWriter.ts b/packages/allure-js-commons/src/sdk/node/writers/InMemoryAllureWriter.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/writers/InMemoryAllureWriter.ts rename to packages/allure-js-commons/src/sdk/node/writers/InMemoryAllureWriter.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/writers/MessageAllureWriter.ts b/packages/allure-js-commons/src/sdk/node/writers/MessageAllureWriter.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/writers/MessageAllureWriter.ts rename to packages/allure-js-commons/src/sdk/node/writers/MessageAllureWriter.ts diff --git a/packages/allure-js-commons/src/new/sdk/node/writers/index.ts b/packages/allure-js-commons/src/sdk/node/writers/index.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/node/writers/index.ts rename to packages/allure-js-commons/src/sdk/node/writers/index.ts diff --git a/packages/allure-js-commons/src/new/sdk/utils.ts b/packages/allure-js-commons/src/sdk/utils.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/utils.ts rename to packages/allure-js-commons/src/sdk/utils.ts diff --git a/packages/allure-js-commons/src/new/sdk/writers/AllureInMemoryWriter.ts b/packages/allure-js-commons/src/sdk/writers/AllureInMemoryWriter.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/writers/AllureInMemoryWriter.ts rename to packages/allure-js-commons/src/sdk/writers/AllureInMemoryWriter.ts diff --git a/packages/allure-js-commons/src/new/sdk/writers/index.ts b/packages/allure-js-commons/src/sdk/writers/index.ts similarity index 100% rename from packages/allure-js-commons/src/new/sdk/writers/index.ts rename to packages/allure-js-commons/src/sdk/writers/index.ts diff --git a/packages/allure-js-commons/src/new/utils.ts b/packages/allure-js-commons/src/utils.ts similarity index 100% rename from packages/allure-js-commons/src/new/utils.ts rename to packages/allure-js-commons/src/utils.ts diff --git a/packages/allure-js-commons/test/spec/FileSystemAllureWriter.spec.ts b/packages/allure-js-commons/test/spec/FileSystemAllureWriter.spec.ts index 5b74830c3..37ed045ff 100644 --- a/packages/allure-js-commons/test/spec/FileSystemAllureWriter.spec.ts +++ b/packages/allure-js-commons/test/spec/FileSystemAllureWriter.spec.ts @@ -2,65 +2,53 @@ import { randomUUID } from "crypto"; import { existsSync, mkdtempSync, readFileSync, readdirSync, writeFileSync } from "fs"; import * as os from "os"; import path from "path"; -import { env } from "process"; import { describe, expect, it } from "vitest"; -import { AllureConfig, AllureRuntime, ContentType, InMemoryAllureWriter } from "allure-js-commons"; +import { AllureNodeReporterRuntime, Config, ContentType, FileSystemAllureWriter } from "../../src/sdk/node"; describe("FileSystemAllureWriter", () => { it("should save attachment from path", () => { const tmp = mkdtempSync(path.join(os.tmpdir(), "foo-")); const allureResults = path.join(tmp, "allure-results"); - const config: AllureConfig = { - resultsDir: allureResults, + const config: Config = { + writer: new FileSystemAllureWriter({ + resultsDir: allureResults, + }), }; - const runtime = new AllureRuntime(config); + const runtime = new AllureNodeReporterRuntime(config); const from = path.join(tmp, "test-attachment.txt"); const data = "test content"; - writeFileSync(from, data); - runtime.writeAttachmentFromPath(from, { contentType: ContentType.TEXT }); + writeFileSync(from, data, "utf8"); + + runtime.startTest({ name: "test" }); + runtime.writeAttachmentFromPath("Attachment", from, { contentType: ContentType.TEXT }); + runtime.stopTest(); + runtime.writeTest(); const resultFiles = readdirSync(allureResults); - expect(resultFiles).toHaveLength(1); - const [actualAttachment] = resultFiles; + expect(resultFiles).toHaveLength(2); + + const attachmentResultPath = resultFiles.find((file) => file.includes("attachment"))!; - const actualContent = readFileSync(path.join(allureResults, actualAttachment)); + const actualContent = readFileSync(path.join(allureResults, attachmentResultPath)); - expect(actualContent.toString("utf-8")).toBe(data); + expect(actualContent.toString("utf8")).toBe(data); }); it("Should create allure-report nested path", () => { const tmpReportPath = path.join(os.tmpdir(), `./allure-testing-dir/${randomUUID()}`); - const config: AllureConfig = { - resultsDir: tmpReportPath, + const config: Config = { + writer: new FileSystemAllureWriter({ + resultsDir: tmpReportPath, + }), }; - new AllureRuntime(config); + new AllureNodeReporterRuntime(config); expect(existsSync(tmpReportPath)).toBe(true); }); - - it("Should add env labels", () => { - const tmpReportPath = path.join(os.tmpdir(), `./allure-testing-dir/${randomUUID()}`); - const writer = new InMemoryAllureWriter(); - - const config: AllureConfig = { - resultsDir: tmpReportPath, - writer, - }; - - env.ALLURE_LABEL_TAG = "testTag"; - const runtime = new AllureRuntime(config); - const group = runtime.startGroup("test_group"); - const test = group.startTest("test_result"); - - test.endTest(); - group.endGroup(); - - expect(writer.tests[0].labels[0]).toEqual({ name: "tag", value: "testTag" }); - }); }); diff --git a/packages/allure-js-commons/test/spec/testPlan.spec.ts b/packages/allure-js-commons/test/spec/testPlan.spec.ts index 5964e4161..b86cbdb30 100644 --- a/packages/allure-js-commons/test/spec/testPlan.spec.ts +++ b/packages/allure-js-commons/test/spec/testPlan.spec.ts @@ -3,7 +3,7 @@ import { mkdtempSync, writeFileSync } from "fs"; import os from "os"; import path from "path"; import { afterEach, expect, it } from "vitest"; -import { parseTestPlan } from "allure-js-commons"; +import { parseTestPlan } from "../../src/sdk/node"; const originalEnv = process.env; const tmpDir = mkdtempSync(path.join(os.tmpdir(), "test-")); diff --git a/packages/allure-js-commons/test/spec/utils.spec.ts b/packages/allure-js-commons/test/spec/utils.spec.ts index 64d841473..fdb6fc24c 100644 --- a/packages/allure-js-commons/test/spec/utils.spec.ts +++ b/packages/allure-js-commons/test/spec/utils.spec.ts @@ -1,7 +1,7 @@ import assert from "node:assert"; import { describe, expect, it } from "vitest"; import { - ExecutableItem, + Executable, LabelName, Status, allureLabelRegexp, @@ -10,7 +10,7 @@ import { isAnyStepFailed, serialize, typeToExtension, -} from "allure-js-commons"; +} from "../../src/sdk/node"; const fixtures = { withoutFailed: { @@ -62,7 +62,7 @@ describe("utils > isAnyStepFailed", () => { it("returns false", () => { // eslint-disable-next-line // @ts-ignore - expect(isAnyStepFailed(fixtures.withoutFailed as ExecutableItem)).toBe(false); + expect(isAnyStepFailed(fixtures.withoutFailed as Executable)).toBe(false); }); }); @@ -70,7 +70,7 @@ describe("utils > isAnyStepFailed", () => { it("returns true", () => { // eslint-disable-next-line // @ts-ignore - expect(isAnyStepFailed(fixtures.withFailedRoot as ExecutableItem)).toBe(true); + expect(isAnyStepFailed(fixtures.withFailedRoot as Executable)).toBe(true); }); }); @@ -78,7 +78,7 @@ describe("utils > isAnyStepFailed", () => { it("returns true", () => { // eslint-disable-next-line // @ts-ignore - expect(isAnyStepFailed(fixtures.withFailedNested as ExecutableItem)).toBe(true); + expect(isAnyStepFailed(fixtures.withFailedNested as Executable)).toBe(true); }); }); }); diff --git a/packages/allure-js-commons/tsconfig.json b/packages/allure-js-commons/tsconfig.json index f469d1bca..58a61bfc4 100644 --- a/packages/allure-js-commons/tsconfig.json +++ b/packages/allure-js-commons/tsconfig.json @@ -1,12 +1,9 @@ { "extends": "../../tsconfig.json", "include": [ - "./src/**/*", - "index.ts", - "internal.ts" + "./src/**/*" ], "exclude": [ - "src/**/__old__/*", "./scripts" ], "compilerOptions": { diff --git a/packages/allure-mocha/rollup.config.mjs b/packages/allure-mocha/rollup.config.mjs index 74568ad82..708eab475 100644 --- a/packages/allure-mocha/rollup.config.mjs +++ b/packages/allure-mocha/rollup.config.mjs @@ -14,7 +14,8 @@ const createNodeEntry = (inputFile) => { "node:os", "node:fs", "node:process", - "allure-js-commons/new/sdk/node", + "allure-js-commons", + "allure-js-commons/sdk/node", ]; return [ diff --git a/packages/allure-mocha/src/ContextBasedTestRuntime.ts b/packages/allure-mocha/src/ContextBasedTestRuntime.ts index 39a63f828..d428b9172 100644 --- a/packages/allure-mocha/src/ContextBasedTestRuntime.ts +++ b/packages/allure-mocha/src/ContextBasedTestRuntime.ts @@ -11,7 +11,7 @@ import { TestRuntime, getStatusFromError, setGlobalTestRuntime, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { errorToStatusDetails } from "./utils"; export class ContextBasedTestRuntime implements TestRuntime { diff --git a/packages/allure-mocha/src/reporter.ts b/packages/allure-mocha/src/reporter.ts index 62b83657f..5be8105ec 100644 --- a/packages/allure-mocha/src/reporter.ts +++ b/packages/allure-mocha/src/reporter.ts @@ -1,7 +1,7 @@ import * as Mocha from "mocha"; import { hostname } from "node:os"; import { env } from "node:process"; -import "allure-js-commons/new"; +import "allure-js-commons"; import { AllureNodeReporterRuntime, Config, @@ -14,7 +14,7 @@ import { getPackageLabelFromPath, getRelativePath, getStatusFromError, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { setUpTestRuntime } from "./ContextBasedTestRuntime.js"; import { getSuitesOfMochaTest } from "./utils.js"; diff --git a/packages/allure-mocha/src/utils.ts b/packages/allure-mocha/src/utils.ts index 2befd4d9c..26e026703 100644 --- a/packages/allure-mocha/src/utils.ts +++ b/packages/allure-mocha/src/utils.ts @@ -1,5 +1,5 @@ import * as Mocha from "mocha"; -import { StatusDetails } from "allure-js-commons/new/sdk/node"; +import { StatusDetails } from "allure-js-commons/sdk/node"; export const errorToStatusDetails = (error: unknown): StatusDetails | undefined => { if (error instanceof Error) { diff --git a/packages/allure-mocha/test/fixtures/samples/description.spec.mjs b/packages/allure-mocha/test/fixtures/samples/description.spec.mjs index e23f6bd8b..c7a9330a7 100644 --- a/packages/allure-mocha/test/fixtures/samples/description.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/description.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { description } from "allure-js-commons/new"; +import { description } from "allure-js-commons"; it("a test with a description", async () => { await description("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/descriptionHtml.spec.mjs b/packages/allure-mocha/test/fixtures/samples/descriptionHtml.spec.mjs index 22f9cc354..a4c83f3d4 100644 --- a/packages/allure-mocha/test/fixtures/samples/descriptionHtml.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/descriptionHtml.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { descriptionHtml } from "allure-js-commons/new"; +import { descriptionHtml } from "allure-js-commons"; it("a test with a description in HTML", async () => { await descriptionHtml("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/fixtures/renamed.spec.mjs b/packages/allure-mocha/test/fixtures/samples/fixtures/renamed.spec.mjs index 31d289aaa..64f1c5d09 100644 --- a/packages/allure-mocha/test/fixtures/samples/fixtures/renamed.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/fixtures/renamed.spec.mjs @@ -1,5 +1,5 @@ import { beforeEach, describe, it } from "mocha"; -import { displayName } from "allure-js-commons/new"; +import { displayName } from "allure-js-commons"; describe("a suite with before", async () => { beforeEach("an initial name", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/labels/bdd/epic.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/bdd/epic.spec.mjs index 7bfc90318..f7f4db5fd 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/bdd/epic.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/bdd/epic.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { epic } from "allure-js-commons/new"; +import { epic } from "allure-js-commons"; it("a test with an epic", async () => { await epic("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/bdd/feature.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/bdd/feature.spec.mjs index 4180fa2ac..d10fd24da 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/bdd/feature.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/bdd/feature.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { feature } from "allure-js-commons/new"; +import { feature } from "allure-js-commons"; it("a test with a feature", async () => { await feature("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/bdd/story.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/bdd/story.spec.mjs index fdeecb232..fed3238e6 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/bdd/story.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/bdd/story.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { story } from "allure-js-commons/new"; +import { story } from "allure-js-commons"; it("a test with a story", async () => { await story("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/custom.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/custom.spec.mjs index 94cccd62d..8b353937f 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/custom.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/custom.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { label } from "allure-js-commons/new"; +import { label } from "allure-js-commons"; it("a test with a custom label", async () => { await label("foo", "bar"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/layer.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/layer.spec.mjs index 187b5aac6..b0d159d65 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/layer.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/layer.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { layer } from "allure-js-commons/new"; +import { layer } from "allure-js-commons"; it("a test with a layer", async () => { await layer("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/multiple.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/multiple.spec.mjs index cb70167ae..40533b57b 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/multiple.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/multiple.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { labels } from "allure-js-commons/new"; +import { labels } from "allure-js-commons"; it("a test with two custom labels", async () => { await labels({ name: "foo", value: "bar" }, { name: "baz", value: "qux" }); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/owner.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/owner.spec.mjs index 1e239e5f8..a918132ba 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/owner.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/owner.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { owner } from "allure-js-commons/new"; +import { owner } from "allure-js-commons"; it("a test with an owner", async () => { await owner("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/severities/blocker.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/severities/blocker.spec.mjs index 9734fa237..ed1406174 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/severities/blocker.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/severities/blocker.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { Severity, severity } from "allure-js-commons/new"; +import { Severity, severity } from "allure-js-commons"; it("a blocker", async () => { await severity(Severity.BLOCKER); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/severities/critical.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/severities/critical.spec.mjs index 949c0fd3e..8f51f0c75 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/severities/critical.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/severities/critical.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { Severity, severity } from "allure-js-commons/new"; +import { Severity, severity } from "allure-js-commons"; it("a critical test", async () => { await severity(Severity.CRITICAL); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/severities/minor.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/severities/minor.spec.mjs index d552bb7bc..cf8164c6d 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/severities/minor.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/severities/minor.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { Severity, severity } from "allure-js-commons/new"; +import { Severity, severity } from "allure-js-commons"; it("a minor test", async () => { await severity(Severity.MINOR); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/severities/normal.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/severities/normal.spec.mjs index 9dd927f4a..350376202 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/severities/normal.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/severities/normal.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { Severity, severity } from "allure-js-commons/new"; +import { Severity, severity } from "allure-js-commons"; it("a normal test", async () => { await severity(Severity.NORMAL); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/severities/trivial.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/severities/trivial.spec.mjs index 38279d769..933732aa4 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/severities/trivial.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/severities/trivial.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { Severity, severity } from "allure-js-commons/new"; +import { Severity, severity } from "allure-js-commons"; it("a trivial test", async () => { await severity(Severity.TRIVIAL); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/suites/parentSuiteFileScope.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/suites/parentSuiteFileScope.spec.mjs index 89758d254..39ed55669 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/suites/parentSuiteFileScope.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/suites/parentSuiteFileScope.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { parentSuite } from "allure-js-commons/new"; +import { parentSuite } from "allure-js-commons"; it("a test with a parent suite", async () => { await parentSuite("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/suites/parentSuiteNestedScope.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/suites/parentSuiteNestedScope.spec.mjs index 7a6513fcb..f975282f4 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/suites/parentSuiteNestedScope.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/suites/parentSuiteNestedScope.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { parentSuite } from "allure-js-commons/new"; +import { parentSuite } from "allure-js-commons"; describe("foo", async () => { describe("bar", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/labels/suites/subSuiteFileScope.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/suites/subSuiteFileScope.spec.mjs index c3df3c8e6..ff3af264b 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/suites/subSuiteFileScope.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/suites/subSuiteFileScope.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { subSuite } from "allure-js-commons/new"; +import { subSuite } from "allure-js-commons"; it("a test with a sub-suite", async () => { await subSuite("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/suites/subSuiteNestedScope.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/suites/subSuiteNestedScope.spec.mjs index 22bf58d67..e8c8c31d0 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/suites/subSuiteNestedScope.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/suites/subSuiteNestedScope.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { subSuite } from "allure-js-commons/new"; +import { subSuite } from "allure-js-commons"; describe("foo", async () => { describe("bar", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/labels/suites/suiteFileScope.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/suites/suiteFileScope.spec.mjs index f965e63b6..65b94d1b2 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/suites/suiteFileScope.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/suites/suiteFileScope.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { suite } from "allure-js-commons/new"; +import { suite } from "allure-js-commons"; it("a test with a suite", async () => { await suite("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/labels/suites/suiteNestedScope.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/suites/suiteNestedScope.spec.mjs index 6873f2358..1456bc1ba 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/suites/suiteNestedScope.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/suites/suiteNestedScope.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { suite } from "allure-js-commons/new"; +import { suite } from "allure-js-commons"; describe("foo", async () => { describe("bar", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/labels/tags.spec.mjs b/packages/allure-mocha/test/fixtures/samples/labels/tags.spec.mjs index a5214a503..851b1a483 100644 --- a/packages/allure-mocha/test/fixtures/samples/labels/tags.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/labels/tags.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { tag } from "allure-js-commons/new"; +import { tag } from "allure-js-commons"; it("a test with tags", async () => { await tag("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/links/multipleLinks.spec.mjs b/packages/allure-mocha/test/fixtures/samples/links/multipleLinks.spec.mjs index 1f891d5fa..2b56e9f83 100644 --- a/packages/allure-mocha/test/fixtures/samples/links/multipleLinks.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/links/multipleLinks.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { links } from "allure-js-commons/new"; +import { links } from "allure-js-commons"; it("a test with two links", async () => { await links( diff --git a/packages/allure-mocha/test/fixtures/samples/links/namedIssue.spec.mjs b/packages/allure-mocha/test/fixtures/samples/links/namedIssue.spec.mjs index 6f5616ef3..21c1d1a5c 100644 --- a/packages/allure-mocha/test/fixtures/samples/links/namedIssue.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/links/namedIssue.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { issue } from "allure-js-commons/new"; +import { issue } from "allure-js-commons"; it("a test with a named issue link", async () => { await issue("https://foo.bar", "baz"); diff --git a/packages/allure-mocha/test/fixtures/samples/links/namedLink.spec.mjs b/packages/allure-mocha/test/fixtures/samples/links/namedLink.spec.mjs index ebaab8ad8..3e02c1768 100644 --- a/packages/allure-mocha/test/fixtures/samples/links/namedLink.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/links/namedLink.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { link } from "allure-js-commons/new"; +import { link } from "allure-js-commons"; it("a test with a named link", async () => { await link("https://foo.bar", "link", "baz"); diff --git a/packages/allure-mocha/test/fixtures/samples/links/namedTms.spec.mjs b/packages/allure-mocha/test/fixtures/samples/links/namedTms.spec.mjs index ac71bc49b..fecdab8d2 100644 --- a/packages/allure-mocha/test/fixtures/samples/links/namedTms.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/links/namedTms.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { tms } from "allure-js-commons/new"; +import { tms } from "allure-js-commons"; it("a test with a named tms link", async () => { await tms("https://foo.bar", "baz"); diff --git a/packages/allure-mocha/test/fixtures/samples/links/urlOnlyIssue.spec.mjs b/packages/allure-mocha/test/fixtures/samples/links/urlOnlyIssue.spec.mjs index 4361dd428..73528af0d 100644 --- a/packages/allure-mocha/test/fixtures/samples/links/urlOnlyIssue.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/links/urlOnlyIssue.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { issue } from "allure-js-commons/new"; +import { issue } from "allure-js-commons"; it("a test with a url only issue link", async () => { await issue("https://foo.bar"); diff --git a/packages/allure-mocha/test/fixtures/samples/links/urlOnlyLink.spec.mjs b/packages/allure-mocha/test/fixtures/samples/links/urlOnlyLink.spec.mjs index 63d92411c..96aad8c4d 100644 --- a/packages/allure-mocha/test/fixtures/samples/links/urlOnlyLink.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/links/urlOnlyLink.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { link } from "allure-js-commons/new"; +import { link } from "allure-js-commons"; it("a test with a url only link", async () => { await link("https://foo.bar"); diff --git a/packages/allure-mocha/test/fixtures/samples/links/urlOnlyTms.spec.mjs b/packages/allure-mocha/test/fixtures/samples/links/urlOnlyTms.spec.mjs index e16d614cf..677ec02c7 100644 --- a/packages/allure-mocha/test/fixtures/samples/links/urlOnlyTms.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/links/urlOnlyTms.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { tms } from "allure-js-commons/new"; +import { tms } from "allure-js-commons"; it("a test with a url only tms link", async () => { await tms("https://foo.bar"); diff --git a/packages/allure-mocha/test/fixtures/samples/links/urlTypeLink.spec.mjs b/packages/allure-mocha/test/fixtures/samples/links/urlTypeLink.spec.mjs index 8e3caa1bb..3bd81f143 100644 --- a/packages/allure-mocha/test/fixtures/samples/links/urlTypeLink.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/links/urlTypeLink.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { link } from "allure-js-commons/new"; +import { link } from "allure-js-commons"; it("a test with a link of a custom type", async () => { await link("https://foo.bar", "baz"); diff --git a/packages/allure-mocha/test/fixtures/samples/parameters/testWithExcludedParameter.spec.mjs b/packages/allure-mocha/test/fixtures/samples/parameters/testWithExcludedParameter.spec.mjs index 583c191d3..1de1dd49d 100644 --- a/packages/allure-mocha/test/fixtures/samples/parameters/testWithExcludedParameter.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/parameters/testWithExcludedParameter.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { parameter } from "allure-js-commons/new"; +import { parameter } from "allure-js-commons"; ["bar", "baz"].forEach((v) => { it("a test with an excluded parameter", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/parameters/testWithHiddenParameter.spec.mjs b/packages/allure-mocha/test/fixtures/samples/parameters/testWithHiddenParameter.spec.mjs index c371a6823..6e625d2ef 100644 --- a/packages/allure-mocha/test/fixtures/samples/parameters/testWithHiddenParameter.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/parameters/testWithHiddenParameter.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { parameter } from "allure-js-commons/new"; +import { parameter } from "allure-js-commons"; it("a test with a hidden parameter", async () => { await parameter("foo", "bar", { mode: "hidden" }); diff --git a/packages/allure-mocha/test/fixtures/samples/parameters/testWithMaskedParameter.spec.mjs b/packages/allure-mocha/test/fixtures/samples/parameters/testWithMaskedParameter.spec.mjs index e8eef2c9d..07869a2d5 100644 --- a/packages/allure-mocha/test/fixtures/samples/parameters/testWithMaskedParameter.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/parameters/testWithMaskedParameter.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { parameter } from "allure-js-commons/new"; +import { parameter } from "allure-js-commons"; it("a test with a masked parameter", async () => { await parameter("foo", "bar", { mode: "masked" }); diff --git a/packages/allure-mocha/test/fixtures/samples/parameters/testWithParameter.spec.mjs b/packages/allure-mocha/test/fixtures/samples/parameters/testWithParameter.spec.mjs index 2fbe47fba..468e1e3cd 100644 --- a/packages/allure-mocha/test/fixtures/samples/parameters/testWithParameter.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/parameters/testWithParameter.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { parameter } from "allure-js-commons/new"; +import { parameter } from "allure-js-commons"; ["bar", "baz"].forEach((v) => { it("a test with a parameter", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/brokenStep.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/brokenStep.spec.mjs index 8b73dc0cd..a534308d8 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/brokenStep.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/brokenStep.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("a broken step", async () => { await step("foo", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/failedStep.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/failedStep.spec.mjs index eab925584..ce958d027 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/failedStep.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/failedStep.spec.mjs @@ -1,6 +1,6 @@ import { expect } from "chai"; import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("a failed step", async () => { await step("foo", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/lambdaStep.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/lambdaStep.spec.mjs index 98e5007ea..c24947fda 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/lambdaStep.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/lambdaStep.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("a lambda step", async () => { await step("foo", async () => {}); diff --git a/packages/allure-mocha/test/fixtures/samples/steps/logStep.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/logStep.spec.mjs index cc4330284..846b8b32e 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/logStep.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/logStep.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("a log step", async () => { await step("foo"); diff --git a/packages/allure-mocha/test/fixtures/samples/steps/renamedStep.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/renamedStep.spec.mjs index f926bf1e9..49df6065a 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/renamedStep.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/renamedStep.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("a renamed step", async () => { await step("foo", async (ctx) => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/stepWithAttachment.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/stepWithAttachment.spec.mjs index 96f8d87b9..3a904e540 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/stepWithAttachment.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/stepWithAttachment.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { attachment, step } from "allure-js-commons/new"; +import { attachment, step } from "allure-js-commons"; it("a step with an attachment", async () => { await step("step", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/stepWithHiddenParameter.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/stepWithHiddenParameter.spec.mjs index 5ee042bd9..cd732ce98 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/stepWithHiddenParameter.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/stepWithHiddenParameter.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("a step with a hidden parameter", async () => { await step("foo", async (ctx) => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/stepWithMaskedParameter.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/stepWithMaskedParameter.spec.mjs index 143aa6d02..0575c9da4 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/stepWithMaskedParameter.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/stepWithMaskedParameter.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("a step with a masked parameter", async () => { await step("foo", async (ctx) => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/stepWithParameter.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/stepWithParameter.spec.mjs index aa822cc6e..70044a5f5 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/stepWithParameter.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/stepWithParameter.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("a step with a parameter", async () => { await step("foo", async (ctx) => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/twoNestedSteps.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/twoNestedSteps.spec.mjs index 001028622..2e4ab2ea6 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/twoNestedSteps.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/twoNestedSteps.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("two nested steps", async () => { await step("foo", async () => { diff --git a/packages/allure-mocha/test/fixtures/samples/steps/twoStepsInRow.spec.mjs b/packages/allure-mocha/test/fixtures/samples/steps/twoStepsInRow.spec.mjs index ad7dab1fa..cea1ab5bd 100644 --- a/packages/allure-mocha/test/fixtures/samples/steps/twoStepsInRow.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/steps/twoStepsInRow.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { step } from "allure-js-commons/new"; +import { step } from "allure-js-commons"; it("two steps in a row", async () => { await step("foo", async () => {}); diff --git a/packages/allure-mocha/test/fixtures/samples/testAttachment.spec.mjs b/packages/allure-mocha/test/fixtures/samples/testAttachment.spec.mjs index e3eb4862f..df1358c57 100644 --- a/packages/allure-mocha/test/fixtures/samples/testAttachment.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/testAttachment.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { attachment } from "allure-js-commons/new"; +import { attachment } from "allure-js-commons"; it("test attachment", async () => { await attachment("foo.txt", Buffer.from("bar"), "text/plain"); diff --git a/packages/allure-mocha/test/fixtures/samples/testDisplayName.spec.mjs b/packages/allure-mocha/test/fixtures/samples/testDisplayName.spec.mjs index b4371720a..08d9a9337 100644 --- a/packages/allure-mocha/test/fixtures/samples/testDisplayName.spec.mjs +++ b/packages/allure-mocha/test/fixtures/samples/testDisplayName.spec.mjs @@ -1,5 +1,5 @@ import { it } from "mocha"; -import { displayName } from "allure-js-commons/new"; +import { displayName } from "allure-js-commons"; it("a renamed test", async () => { await displayName("foo"); diff --git a/packages/allure-mocha/test/spec/api/globalLabels.test.ts b/packages/allure-mocha/test/spec/api/globalLabels.test.ts index 214ee3224..1f723d767 100644 --- a/packages/allure-mocha/test/spec/api/globalLabels.test.ts +++ b/packages/allure-mocha/test/spec/api/globalLabels.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { Label } from "allure-js-commons/new/sdk/node"; +import { Label } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../utils"; describe("env labels", () => { diff --git a/packages/allure-mocha/test/spec/api/runtime/attachments.test.ts b/packages/allure-mocha/test/spec/api/runtime/attachments.test.ts index cdc35d27d..f0b978b9a 100644 --- a/packages/allure-mocha/test/spec/api/runtime/attachments.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/attachments.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { AllureResults } from "allure-js-commons/new/sdk/node"; +import { AllureResults } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../../utils"; describe("test attachments", () => { diff --git a/packages/allure-mocha/test/spec/api/runtime/bdd.test.ts b/packages/allure-mocha/test/spec/api/runtime/bdd.test.ts index 80ba5f95d..1eaca53c1 100644 --- a/packages/allure-mocha/test/spec/api/runtime/bdd.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/bdd.test.ts @@ -1,6 +1,6 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { TestResult } from "allure-js-commons/new"; -import { LabelName } from "allure-js-commons/new/sdk/node"; +import { TestResult } from "allure-js-commons"; +import { LabelName } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../../utils"; describe("bdd labels", () => { diff --git a/packages/allure-mocha/test/spec/api/runtime/labels.test.ts b/packages/allure-mocha/test/spec/api/runtime/labels.test.ts index fdf147f31..8fac04b97 100644 --- a/packages/allure-mocha/test/spec/api/runtime/labels.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/labels.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { TestResult } from "allure-js-commons/new/sdk/node"; +import { TestResult } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../../utils"; describe("label runtime API", () => { diff --git a/packages/allure-mocha/test/spec/api/runtime/links.test.ts b/packages/allure-mocha/test/spec/api/runtime/links.test.ts index 43ea840d2..88aa386bb 100644 --- a/packages/allure-mocha/test/spec/api/runtime/links.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/links.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { TestResult } from "allure-js-commons/new/sdk/node"; +import { TestResult } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../../utils"; describe("link", () => { diff --git a/packages/allure-mocha/test/spec/api/runtime/metadata.test.ts b/packages/allure-mocha/test/spec/api/runtime/metadata.test.ts index 8ac6d5c70..0ed905f8f 100644 --- a/packages/allure-mocha/test/spec/api/runtime/metadata.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/metadata.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { TestResult } from "allure-js-commons/new/sdk/node"; +import { TestResult } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../../utils"; describe("test metadata api", () => { diff --git a/packages/allure-mocha/test/spec/api/runtime/parameters.test.ts b/packages/allure-mocha/test/spec/api/runtime/parameters.test.ts index 48d7d76a7..b895a4d07 100644 --- a/packages/allure-mocha/test/spec/api/runtime/parameters.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/parameters.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { TestResult } from "allure-js-commons/new/sdk/node"; +import { TestResult } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../../utils"; describe("runtime parameter", () => { diff --git a/packages/allure-mocha/test/spec/api/runtime/steps.test.ts b/packages/allure-mocha/test/spec/api/runtime/steps.test.ts index a4cba1fbf..0e63ec205 100644 --- a/packages/allure-mocha/test/spec/api/runtime/steps.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/steps.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { Stage, Status, TestResult } from "allure-js-commons/new/sdk/node"; +import { Stage, Status, TestResult } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../../utils"; describe("step", () => { diff --git a/packages/allure-mocha/test/spec/api/runtime/suites.test.ts b/packages/allure-mocha/test/spec/api/runtime/suites.test.ts index 271e486a3..130c387aa 100644 --- a/packages/allure-mocha/test/spec/api/runtime/suites.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/suites.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it, test } from "vitest"; -import { TestResult } from "allure-js-commons/new"; +import { TestResult } from "allure-js-commons"; import { runMochaInlineTest } from "../../../utils"; describe("suites", () => { @@ -20,7 +20,7 @@ describe("suites", () => { ["labels", "suites", "subSuiteNestedScope"], ); for (const testResult of tests) { - testMap.set(testResult.name as string, testResult); + testMap.set(testResult.name as string, testResult as TestResult); } }); diff --git a/packages/allure-mocha/test/spec/api/runtime/tags.test.ts b/packages/allure-mocha/test/spec/api/runtime/tags.test.ts index a7680ad2a..69ac337fa 100644 --- a/packages/allure-mocha/test/spec/api/runtime/tags.test.ts +++ b/packages/allure-mocha/test/spec/api/runtime/tags.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk/node"; +import { LabelName } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../../utils"; it("tags can be added at runtime", async () => { diff --git a/packages/allure-mocha/test/spec/framework/containers.test.ts b/packages/allure-mocha/test/spec/framework/containers.test.ts index 8d8dd7991..5b7a9d534 100644 --- a/packages/allure-mocha/test/spec/framework/containers.test.ts +++ b/packages/allure-mocha/test/spec/framework/containers.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { TestResultContainer } from "allure-js-commons/new/sdk/node"; +import { TestResultContainer } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../utils"; describe("containers", () => { diff --git a/packages/allure-mocha/test/spec/framework/fixtures.test.ts b/packages/allure-mocha/test/spec/framework/fixtures.test.ts index 1c8aabe6a..ed913b955 100644 --- a/packages/allure-mocha/test/spec/framework/fixtures.test.ts +++ b/packages/allure-mocha/test/spec/framework/fixtures.test.ts @@ -1,6 +1,6 @@ /* eslint @typescript-eslint/quotes: off */ import { beforeAll, describe, expect, it } from "vitest"; -import { FixtureResult, TestResult, TestResultContainer } from "allure-js-commons/new/sdk/node"; +import { FixtureResult, TestResult, TestResultContainer } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../utils"; describe("fixtures", () => { diff --git a/packages/allure-mocha/test/spec/framework/result.test.ts b/packages/allure-mocha/test/spec/framework/result.test.ts index c8518bdce..fde348b2c 100644 --- a/packages/allure-mocha/test/spec/framework/result.test.ts +++ b/packages/allure-mocha/test/spec/framework/result.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { TestResult } from "allure-js-commons/new/sdk/node"; +import { TestResult } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../utils"; describe("defaults", () => { diff --git a/packages/allure-mocha/test/spec/framework/statuses.test.ts b/packages/allure-mocha/test/spec/framework/statuses.test.ts index b83e412d6..ae6d1b38d 100644 --- a/packages/allure-mocha/test/spec/framework/statuses.test.ts +++ b/packages/allure-mocha/test/spec/framework/statuses.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, it } from "vitest"; -import { Stage, Status, TestResult } from "allure-js-commons/new/sdk/node"; +import { Stage, Status, TestResult } from "allure-js-commons/sdk/node"; import { runMochaInlineTest } from "../../utils"; describe("test status", () => { diff --git a/packages/allure-mocha/test/utils.ts b/packages/allure-mocha/test/utils.ts index f9f08b6d3..9b69438be 100644 --- a/packages/allure-mocha/test/utils.ts +++ b/packages/allure-mocha/test/utils.ts @@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto"; import { appendFileSync } from "node:fs"; import { copyFile, mkdir, writeFile } from "node:fs/promises"; import * as path from "node:path"; -import { AllureResults, TestResult, TestResultContainer } from "allure-js-commons/new/sdk/node"; +import { AllureResults, TestResult, TestResultContainer } from "allure-js-commons/sdk/node"; type MochaRunOptions = { env?: { [keys: string]: string }; @@ -35,7 +35,7 @@ export const runMochaInlineTest = async ( const reporterPath = path.join(testDir, "reporter.cjs"); const reporterContent = ` const MochaAllureReporter = require('allure-mocha').default; - const { MessageAllureWriter } = require("allure-js-commons/new/sdk/node"); + const { MessageAllureWriter } = require("allure-js-commons/sdk/node"); class ProcessMessageAllureReporter extends MochaAllureReporter { constructor(runner, opts) { if (opts.reporterOptions?.emitFiles !== 'true') { diff --git a/packages/allure-playwright/rollup.config.mjs b/packages/allure-playwright/rollup.config.mjs index 983a17824..c12d88c8e 100644 --- a/packages/allure-playwright/rollup.config.mjs +++ b/packages/allure-playwright/rollup.config.mjs @@ -16,9 +16,9 @@ const createNodeEntry = (inputFile) => { "node:process", "node:path", "strip-ansi", - "allure-js-commons/new", - "allure-js-commons/new/sdk/node", - "allure-js-commons/new/internal", + "allure-js-commons", + "allure-js-commons/sdk/node", + "allure-js-commons/internal", "@playwright/test", ]; diff --git a/packages/allure-playwright/src/index.ts b/packages/allure-playwright/src/index.ts index 13556f181..db116d7a9 100644 --- a/packages/allure-playwright/src/index.ts +++ b/packages/allure-playwright/src/index.ts @@ -1,5 +1,5 @@ import test from "@playwright/test"; -import { ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from "allure-js-commons/new/internal"; +import { ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from "allure-js-commons/internal"; import { ContentType, Label, @@ -13,7 +13,7 @@ import { TestRuntime, getStatusFromError, setGlobalTestRuntime, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; class AllurePlaywrightTestRuntime implements TestRuntime { async label(name: LabelName | string, value: string) { diff --git a/packages/allure-playwright/src/model.ts b/packages/allure-playwright/src/model.ts index e1776f489..5db0116f5 100644 --- a/packages/allure-playwright/src/model.ts +++ b/packages/allure-playwright/src/model.ts @@ -1,4 +1,4 @@ -import { Category, Config } from "allure-js-commons/new/sdk/node"; +import { Category, Config } from "allure-js-commons/sdk/node"; export interface AllurePlaywrightReporterConfig extends Omit { detail?: boolean; diff --git a/packages/allure-playwright/src/reporter.ts b/packages/allure-playwright/src/reporter.ts index 2a3369d8d..ab425eca0 100644 --- a/packages/allure-playwright/src/reporter.ts +++ b/packages/allure-playwright/src/reporter.ts @@ -6,7 +6,7 @@ import path from "node:path"; import process from "node:process"; import stripAnsi from "strip-ansi"; import { ContentType, ImageDiffAttachment } from "allure-js-commons"; -import { ALLURE_IMAGEDIFF_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from "allure-js-commons/new/internal"; +import { ALLURE_IMAGEDIFF_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from "allure-js-commons/internal"; import { AllureNodeReporterRuntime, FileSystemAllureWriter, @@ -19,7 +19,7 @@ import { TestResult, extractMetadataFromString, readImageAsBase64, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { AllurePlaywrightReporterConfig } from "./model.js"; import { getStatusDetails, hasLabel, statusToAllureStats } from "./utils.js"; diff --git a/packages/allure-playwright/src/testplan.ts b/packages/allure-playwright/src/testplan.ts index 08077e624..480562ea9 100644 --- a/packages/allure-playwright/src/testplan.ts +++ b/packages/allure-playwright/src/testplan.ts @@ -1,4 +1,4 @@ -import { escapeRegExp, parseTestPlan } from "allure-js-commons/new/sdk/node"; +import { escapeRegExp, parseTestPlan } from "allure-js-commons/sdk/node"; export const testPlanFilter = () => { const testPlan = parseTestPlan(); diff --git a/packages/allure-playwright/src/utils.ts b/packages/allure-playwright/src/utils.ts index 9b621672a..ac47038cd 100644 --- a/packages/allure-playwright/src/utils.ts +++ b/packages/allure-playwright/src/utils.ts @@ -1,7 +1,7 @@ import { TestStatus } from "@playwright/test"; import { TestError } from "@playwright/test/reporter"; import stripAnsi from "strip-ansi"; -import { LabelName, Status, StatusDetails, TestResult } from "allure-js-commons/new/sdk/node"; +import { LabelName, Status, StatusDetails, TestResult } from "allure-js-commons/sdk/node"; export const statusToAllureStats = (status: TestStatus, expectedStatus: TestStatus): Status => { if (status === "skipped") { diff --git a/packages/allure-playwright/test/spec/attachment.spec.ts b/packages/allure-playwright/test/spec/attachment.spec.ts index 63a68621d..71ba2c863 100644 --- a/packages/allure-playwright/test/spec/attachment.spec.ts +++ b/packages/allure-playwright/test/spec/attachment.spec.ts @@ -1,7 +1,7 @@ import { readFileSync } from "node:fs"; import { resolve } from "node:path"; import { expect, it } from "vitest"; -import { ContentType } from "allure-js-commons/new/sdk/node"; +import { ContentType } from "allure-js-commons/sdk/node"; import { runPlaywrightInlineTest } from "../utils"; it("doesn't not throw on missing attachment", async () => { @@ -62,7 +62,7 @@ it("should add attachments into steps", async () => { const { tests, attachments } = await runPlaywrightInlineTest({ "sample.test.js": ` import test from 'allure-playwright'; - import { step, attachment } from 'allure-js-commons/new'; + import { step, attachment } from 'allure-js-commons/'; test('should add attachment', async ({}, testInfo) => { await step('outer step 1', async () => { @@ -161,7 +161,7 @@ it("doesn't not report detail steps for attachments", async () => { const { tests, attachments } = await runPlaywrightInlineTest({ "sample.test.js": ` import test from 'allure-playwright'; - import { step, attachment } from 'allure-js-commons/new'; + import { step, attachment } from 'allure-js-commons/'; test('should add attachment', async ({}, testInfo) => { await step('outer step 1', async () => { diff --git a/packages/allure-playwright/test/spec/categories.spec.ts b/packages/allure-playwright/test/spec/categories.spec.ts index 64586f13e..7c3d114d6 100644 --- a/packages/allure-playwright/test/spec/categories.spec.ts +++ b/packages/allure-playwright/test/spec/categories.spec.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Status } from "allure-js-commons/new/sdk/node"; +import { Status } from "allure-js-commons/sdk/node"; import { runPlaywrightInlineTest } from "../utils"; it("has categories", async () => { diff --git a/packages/allure-playwright/test/spec/labelOverride.spec.ts b/packages/allure-playwright/test/spec/labelOverride.spec.ts index 418845e75..9d8a1fc86 100644 --- a/packages/allure-playwright/test/spec/labelOverride.spec.ts +++ b/packages/allure-playwright/test/spec/labelOverride.spec.ts @@ -1,12 +1,12 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk/node"; +import { LabelName } from "allure-js-commons/sdk/node"; import { runPlaywrightInlineTest } from "../utils"; it("overrides suite label", async () => { const { tests } = await runPlaywrightInlineTest({ "a.test.ts": ` import { test, expect } from 'allure-playwright'; - import { suite } from "allure-js-commons/new" + import { suite } from "allure-js-commons" test('should override SUITE label', async ({}) => { await suite('SUITE Override'); @@ -26,7 +26,7 @@ it("overrides parent-suite label", async () => { const { tests } = await runPlaywrightInlineTest({ "a.test.ts": ` import { test, expect } from 'allure-playwright'; - import { parentSuite } from "allure-js-commons/new" + import { parentSuite } from "allure-js-commons" test('should override PARENT SUITE label', async ({}) => { await parentSuite('PARENT SUITE Override'); @@ -46,7 +46,7 @@ it("overrides sub-suite label", async () => { const { tests } = await runPlaywrightInlineTest({ "a.test.ts": ` import { test, expect } from 'allure-playwright'; - import { subSuite } from "allure-js-commons/new" + import { subSuite } from "allure-js-commons" test('should override SUB SUITE label', async ({}) => { await subSuite('SUB SUITE Override'); diff --git a/packages/allure-playwright/test/spec/labels.spec.ts b/packages/allure-playwright/test/spec/labels.spec.ts index e95e5bdf5..221eac39a 100644 --- a/packages/allure-playwright/test/spec/labels.spec.ts +++ b/packages/allure-playwright/test/spec/labels.spec.ts @@ -20,7 +20,7 @@ it("sets runtime labels", async () => { severity, story, tag, - } from "allure-js-commons/new"; + } from "allure-js-commons"; test("should add epic label", async ({}, testInfo) => { await label("foo", "bar"); diff --git a/packages/allure-playwright/test/spec/links.spec.ts b/packages/allure-playwright/test/spec/links.spec.ts index 39be43175..82668eb3a 100644 --- a/packages/allure-playwright/test/spec/links.spec.ts +++ b/packages/allure-playwright/test/spec/links.spec.ts @@ -1,12 +1,12 @@ import { expect, it } from "vitest"; -import { LinkType } from "allure-js-commons/new"; +import { LinkType } from "allure-js-commons"; import { runPlaywrightInlineTest } from "../utils"; it("sets runtime links", async () => { const results = await runPlaywrightInlineTest({ "sample.test.js": ` import { test } from 'allure-playwright'; - import { link, links, issue, tms } from 'allure-js-commons/new'; + import { link, links, issue, tms } from 'allure-js-commons/'; test('should add epic link', async ({}, testInfo) => { await link("https://playwright.dev/docs/api/class-page#page-workers"); diff --git a/packages/allure-playwright/test/spec/parameters.spec.ts b/packages/allure-playwright/test/spec/parameters.spec.ts index 4a3b1b2ed..0dfa7ce76 100644 --- a/packages/allure-playwright/test/spec/parameters.spec.ts +++ b/packages/allure-playwright/test/spec/parameters.spec.ts @@ -6,7 +6,7 @@ it("sets parameters", async () => { { "sample.test.js": ` import { test, expect } from 'allure-playwright'; - import { parameter } from "allure-js-commons/new"; + import { parameter } from "allure-js-commons"; test('should add epic label', async ({}) => { await parameter("param1", "paramValue1"); diff --git a/packages/allure-playwright/test/spec/stdio.spec.ts b/packages/allure-playwright/test/spec/stdio.spec.ts index 0613af24a..0fa9c2289 100644 --- a/packages/allure-playwright/test/spec/stdio.spec.ts +++ b/packages/allure-playwright/test/spec/stdio.spec.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { ContentType } from "allure-js-commons/new/sdk/node"; +import { ContentType } from "allure-js-commons/sdk/node"; import { runPlaywrightInlineTest } from "../utils"; it("reports stdout", async () => { diff --git a/packages/allure-playwright/test/spec/steps.spec.ts b/packages/allure-playwright/test/spec/steps.spec.ts index 6db81e64b..07b21805d 100644 --- a/packages/allure-playwright/test/spec/steps.spec.ts +++ b/packages/allure-playwright/test/spec/steps.spec.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Stage, Status } from "allure-js-commons/new/sdk/node"; +import { Stage, Status } from "allure-js-commons/sdk/node"; import { runPlaywrightInlineTest } from "../utils"; it("reports test steps", async () => { diff --git a/packages/allure-playwright/test/spec/tags.spec.ts b/packages/allure-playwright/test/spec/tags.spec.ts index 83c54d76c..7b9f62f25 100644 --- a/packages/allure-playwright/test/spec/tags.spec.ts +++ b/packages/allure-playwright/test/spec/tags.spec.ts @@ -1,12 +1,12 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk/node"; +import { LabelName } from "allure-js-commons/sdk/node"; import { runPlaywrightInlineTest } from "../utils"; it("sets multiply tags", async () => { const results = await runPlaywrightInlineTest({ "sample.test.js": ` import { test } from 'allure-playwright'; - import { tag, tags } from 'allure-js-commons/new'; + import { tag, tags } from 'allure-js-commons'; test('should add multiply tags', async ({}, testInfo) => { await tag('Allure'); diff --git a/packages/allure-playwright/test/spec/testplan.spec.ts b/packages/allure-playwright/test/spec/testplan.spec.ts index e2a97b152..551513a34 100644 --- a/packages/allure-playwright/test/spec/testplan.spec.ts +++ b/packages/allure-playwright/test/spec/testplan.spec.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { TestPlanV1 } from "allure-js-commons/new/sdk/node"; +import { TestPlanV1 } from "allure-js-commons/sdk/node"; import { runPlaywrightInlineTest } from "../utils"; it("respects testplan", async () => { diff --git a/packages/allure-playwright/test/spec/titleMetadata.spec.ts b/packages/allure-playwright/test/spec/titleMetadata.spec.ts index 9a69e5a5e..c65825bb0 100644 --- a/packages/allure-playwright/test/spec/titleMetadata.spec.ts +++ b/packages/allure-playwright/test/spec/titleMetadata.spec.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { LabelName } from "allure-js-commons/new/sdk/node"; +import { LabelName } from "allure-js-commons/sdk/node"; import { runPlaywrightInlineTest } from "../utils"; it("has metadata from title", async () => { diff --git a/packages/allure-playwright/test/utils.ts b/packages/allure-playwright/test/utils.ts index 6bedf3825..6fa974808 100644 --- a/packages/allure-playwright/test/utils.ts +++ b/packages/allure-playwright/test/utils.ts @@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto"; import { mkdir, rm, writeFile } from "node:fs/promises"; import { dirname, join } from "node:path"; import { parse } from "properties"; -import { AllureResults, EnvironmentInfo, TestResult, TestResultContainer } from "allure-js-commons/new/sdk/node"; +import { AllureResults, EnvironmentInfo, TestResult, TestResultContainer } from "allure-js-commons/sdk/node"; const parseJsonResult = (data: string) => { return JSON.parse(Buffer.from(data, "base64").toString("utf8")) as T; diff --git a/packages/allure-vitest/rollup.config.mjs b/packages/allure-vitest/rollup.config.mjs index 7df7d2a3a..c84df3fda 100644 --- a/packages/allure-vitest/rollup.config.mjs +++ b/packages/allure-vitest/rollup.config.mjs @@ -14,9 +14,9 @@ const createNodeEntry = (inputFile) => { "node:os", "node:path", "node:process", - "allure-js-commons/new", - "allure-js-commons/new/sdk/node", - "allure-js-commons/new/internal", + "allure-js-commons", + "allure-js-commons/sdk/node", + "allure-js-commons/internal", "vitest", ]; diff --git a/packages/allure-vitest/src/reporter.ts b/packages/allure-vitest/src/reporter.ts index 270df72b0..e4b3726c7 100644 --- a/packages/allure-vitest/src/reporter.ts +++ b/packages/allure-vitest/src/reporter.ts @@ -2,7 +2,7 @@ import { hostname } from "node:os"; import { basename, normalize, relative } from "node:path"; import { cwd, env } from "node:process"; import { File, Reporter, Task } from "vitest"; -import { ALLURE_SKIPPED_BY_TEST_PLAN_LABEL } from "allure-js-commons/new/internal"; +import { ALLURE_SKIPPED_BY_TEST_PLAN_LABEL } from "allure-js-commons/internal"; import { AllureNodeReporterRuntime, Config, @@ -14,7 +14,7 @@ import { Status, extractMetadataFromString, getSuitesLabels, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { getSuitePath, getTestFullName } from "./utils.js"; export interface AllureVitestReporterConfig extends Omit { diff --git a/packages/allure-vitest/src/setup.ts b/packages/allure-vitest/src/setup.ts index 3267b1c92..5818899b4 100644 --- a/packages/allure-vitest/src/setup.ts +++ b/packages/allure-vitest/src/setup.ts @@ -1,7 +1,7 @@ /* eslint @typescript-eslint/require-await: off */ import { cwd } from "node:process"; import { type TaskContext, afterAll, afterEach, beforeAll, beforeEach } from "vitest"; -import { ALLURE_SKIPPED_BY_TEST_PLAN_LABEL } from "allure-js-commons/new/internal"; +import { ALLURE_SKIPPED_BY_TEST_PLAN_LABEL } from "allure-js-commons/internal"; import { ContentType, Label, @@ -20,7 +20,7 @@ import { getGlobalTestRuntime, parseTestPlan, setGlobalTestRuntime, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { getTestFullName } from "./utils.js"; export class AllureVitestTestRuntime implements TestRuntime { diff --git a/packages/allure-vitest/test/spec/attachments.test.ts b/packages/allure-vitest/test/spec/attachments.test.ts index cb54717f5..a44a0af38 100644 --- a/packages/allure-vitest/test/spec/attachments.test.ts +++ b/packages/allure-vitest/test/spec/attachments.test.ts @@ -4,7 +4,7 @@ import { runVitestInlineTest } from "../utils.js"; it("adds attachments", async () => { const { tests, attachments } = await runVitestInlineTest(` import { test } from "vitest"; - import { attachment } from "allure-js-commons/new"; + import { attachment } from "allure-js-commons"; test("text attachment", async () => { await attachment("foo.txt", Buffer.from("bar"), "text/plain"); diff --git a/packages/allure-vitest/test/spec/base.test.ts b/packages/allure-vitest/test/spec/base.test.ts index ed3eb59f6..1d4f70d55 100644 --- a/packages/allure-vitest/test/spec/base.test.ts +++ b/packages/allure-vitest/test/spec/base.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "vitest"; -import { Stage, Status } from "allure-js-commons/new/sdk/node"; +import { Stage, Status } from "allure-js-commons/sdk/node"; import { runVitestInlineTest } from "../utils.js"; it("reports passed test", async () => { diff --git a/packages/allure-vitest/test/spec/dataTable.test.ts b/packages/allure-vitest/test/spec/dataTable.test.ts index a418707fa..df262878a 100644 --- a/packages/allure-vitest/test/spec/dataTable.test.ts +++ b/packages/allure-vitest/test/spec/dataTable.test.ts @@ -4,7 +4,7 @@ import { runVitestInlineTest } from "../utils.js"; it("handles data table", async () => { const { tests } = await runVitestInlineTest(` import { test, expect } from "vitest"; - import { label } from "allure-js-commons/new"; + import { label } from "allure-js-commons"; test.each([ [1, 1, 2], diff --git a/packages/allure-vitest/test/spec/description.test.ts b/packages/allure-vitest/test/spec/description.test.ts index 2c8395cda..646264177 100644 --- a/packages/allure-vitest/test/spec/description.test.ts +++ b/packages/allure-vitest/test/spec/description.test.ts @@ -4,7 +4,7 @@ import { runVitestInlineTest } from "../utils.js"; it("sets description", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { description } from "allure-js-commons/new"; + import { description } from "allure-js-commons"; test("description", async () => { await description("foo"); @@ -18,7 +18,7 @@ it("sets description", async () => { it("sets html description", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { descriptionHtml } from "allure-js-commons/new"; + import { descriptionHtml } from "allure-js-commons"; test("description html", async () => { await descriptionHtml("foo"); diff --git a/packages/allure-vitest/test/spec/displayName.test.ts b/packages/allure-vitest/test/spec/displayName.test.ts index b421b8601..45c8d498e 100644 --- a/packages/allure-vitest/test/spec/displayName.test.ts +++ b/packages/allure-vitest/test/spec/displayName.test.ts @@ -4,7 +4,7 @@ import { runVitestInlineTest } from "../utils.js"; it("sets test display name", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { displayName } from "allure-js-commons/new"; + import { displayName } from "allure-js-commons"; test("display name", async () => { await displayName("foo"); diff --git a/packages/allure-vitest/test/spec/historyId.test.ts b/packages/allure-vitest/test/spec/historyId.test.ts index f279cdcb4..97144a5fc 100644 --- a/packages/allure-vitest/test/spec/historyId.test.ts +++ b/packages/allure-vitest/test/spec/historyId.test.ts @@ -4,7 +4,7 @@ import { runVitestInlineTest } from "../utils.js"; it("sets test history id", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { historyId } from "allure-js-commons/new"; + import { historyId } from "allure-js-commons"; test("history id", async () => { await historyId("foo"); diff --git a/packages/allure-vitest/test/spec/labels.test.ts b/packages/allure-vitest/test/spec/labels.test.ts index 6a83e5b55..918b7014a 100644 --- a/packages/allure-vitest/test/spec/labels.test.ts +++ b/packages/allure-vitest/test/spec/labels.test.ts @@ -6,7 +6,7 @@ describe("labels", () => { it("label", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { label } from "allure-js-commons/new"; + import { label } from "allure-js-commons"; test("label", async () => { await label("foo", "bar"); @@ -20,7 +20,7 @@ describe("labels", () => { it("epic", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { epic } from "allure-js-commons/new"; + import { epic } from "allure-js-commons"; test("epic", async () => { await epic("foo"); @@ -34,7 +34,7 @@ describe("labels", () => { it("feature", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { feature } from "allure-js-commons/new"; + import { feature } from "allure-js-commons"; test("feature", async () => { await feature("foo"); @@ -48,7 +48,7 @@ describe("labels", () => { it("story", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { story } from "allure-js-commons/new"; + import { story } from "allure-js-commons"; test("story", async () => { await story("foo"); @@ -62,7 +62,7 @@ describe("labels", () => { it("suite", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { suite } from "allure-js-commons/new"; + import { suite } from "allure-js-commons"; test("suite", async () => { await suite("foo"); @@ -76,7 +76,7 @@ describe("labels", () => { it("parentSuite", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { parentSuite } from "allure-js-commons/new"; + import { parentSuite } from "allure-js-commons"; test("parentSuite", async () => { await parentSuite("foo"); @@ -90,7 +90,7 @@ describe("labels", () => { it("subSuite", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { subSuite } from "allure-js-commons/new"; + import { subSuite } from "allure-js-commons"; test("subSuite", async () => { await subSuite("foo"); @@ -104,7 +104,7 @@ describe("labels", () => { it("owner", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { owner } from "allure-js-commons/new"; + import { owner } from "allure-js-commons"; test("owner", async () => { await owner("foo"); @@ -118,7 +118,7 @@ describe("labels", () => { it("severity", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { severity } from "allure-js-commons/new"; + import { severity } from "allure-js-commons"; test("severity", async () => { await severity("foo"); @@ -132,7 +132,7 @@ describe("labels", () => { it("layer", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { layer } from "allure-js-commons/new"; + import { layer } from "allure-js-commons"; test("layer", async () => { await layer("foo"); @@ -146,7 +146,7 @@ describe("labels", () => { it("id", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { allureId } from "allure-js-commons/new"; + import { allureId } from "allure-js-commons"; test("allureId", async () => { await allureId("foo"); @@ -160,7 +160,7 @@ describe("labels", () => { it("tag", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { tag } from "allure-js-commons/new"; + import { tag } from "allure-js-commons"; test("tag", async () => { await tag("foo"); diff --git a/packages/allure-vitest/test/spec/links.test.ts b/packages/allure-vitest/test/spec/links.test.ts index ba46f4895..ec6126144 100644 --- a/packages/allure-vitest/test/spec/links.test.ts +++ b/packages/allure-vitest/test/spec/links.test.ts @@ -7,7 +7,7 @@ describe("links", () => { const { tests } = await runVitestInlineTest( ` import { test } from "vitest"; - import { link } from "allure-js-commons/new"; + import { link } from "allure-js-commons"; test("link", async (t) => { await link("https://example.org", "foo", "bar"); @@ -27,7 +27,7 @@ describe("links", () => { const { tests } = await runVitestInlineTest( ` import { test } from "vitest"; - import { issue } from "allure-js-commons/new"; + import { issue } from "allure-js-commons"; test("issue", async () => { await issue("https://example.org/issue/1", "foo"); @@ -53,7 +53,7 @@ describe("links", () => { const { tests } = await runVitestInlineTest( ` import { test } from "vitest"; - import { tms } from "allure-js-commons/new"; + import { tms } from "allure-js-commons"; test("tms", async () => { await tms("https://example.org/tms/1", "foo"); diff --git a/packages/allure-vitest/test/spec/parameters.test.ts b/packages/allure-vitest/test/spec/parameters.test.ts index bb3f2e91f..1f81553e1 100644 --- a/packages/allure-vitest/test/spec/parameters.test.ts +++ b/packages/allure-vitest/test/spec/parameters.test.ts @@ -4,7 +4,7 @@ import { runVitestInlineTest } from "../utils.js"; it("sets parameters", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { parameter } from "allure-js-commons/new"; + import { parameter } from "allure-js-commons"; test("parameter", async () => { await parameter("foo", "bar", { mode: "hidden", excluded: true }); diff --git a/packages/allure-vitest/test/spec/steps.test.ts b/packages/allure-vitest/test/spec/steps.test.ts index 7bd5892f0..a64d3a346 100644 --- a/packages/allure-vitest/test/spec/steps.test.ts +++ b/packages/allure-vitest/test/spec/steps.test.ts @@ -5,7 +5,7 @@ import { runVitestInlineTest } from "../utils.js"; it("handles single lambda step", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { step } from "allure-js-commons/new"; + import { step } from "allure-js-commons"; test("steps", async () => { await step("step", () => {}); @@ -24,7 +24,7 @@ it("handles single lambda step", async () => { it("handles single lambda step with attachment", async () => { const { tests, attachments } = await runVitestInlineTest(` import { test } from "vitest"; - import { step, attachment } from "allure-js-commons/new"; + import { step, attachment } from "allure-js-commons"; test("steps", async () => { await step("step", async () => { @@ -47,7 +47,7 @@ it("handles single lambda step with attachment", async () => { it("handles nested lambda steps", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { step } from "allure-js-commons/new"; + import { step } from "allure-js-commons"; test("steps", async () => { await step("step 1", async () => { @@ -83,7 +83,7 @@ it("handles nested lambda steps", async () => { it("handles step renaming", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { step } from "allure-js-commons/new"; + import { step } from "allure-js-commons"; test("steps", async () => { await step("foo", async (ctx) => { @@ -100,7 +100,7 @@ it("handles step renaming", async () => { it("supports step parameters", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { step } from "allure-js-commons/new"; + import { step } from "allure-js-commons"; test("steps", async () => { await step("foo", async (ctx) => { diff --git a/packages/allure-vitest/test/spec/testCaseId.test.ts b/packages/allure-vitest/test/spec/testCaseId.test.ts index 635627089..7fedd8f8a 100644 --- a/packages/allure-vitest/test/spec/testCaseId.test.ts +++ b/packages/allure-vitest/test/spec/testCaseId.test.ts @@ -4,7 +4,7 @@ import { runVitestInlineTest } from "../utils.js"; it("sets test case id", async () => { const { tests } = await runVitestInlineTest(` import { test } from "vitest"; - import { testCaseId } from "allure-js-commons/new"; + import { testCaseId } from "allure-js-commons"; test("test case id", async () => { await testCaseId("foo"); diff --git a/packages/allure-vitest/test/utils.ts b/packages/allure-vitest/test/utils.ts index 5b0d11fca..cd717183d 100644 --- a/packages/allure-vitest/test/utils.ts +++ b/packages/allure-vitest/test/utils.ts @@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto"; import { mkdir, rm, writeFile } from "node:fs/promises"; import { dirname, join } from "node:path"; import { fileURLToPath } from "url"; -import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons/new"; +import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons"; const fileDirname = dirname(fileURLToPath(import.meta.url)); diff --git a/packages/newman-reporter-allure/rollup.config.mjs b/packages/newman-reporter-allure/rollup.config.mjs index fceb3889a..9007fe4e0 100644 --- a/packages/newman-reporter-allure/rollup.config.mjs +++ b/packages/newman-reporter-allure/rollup.config.mjs @@ -16,9 +16,9 @@ const createNodeEntry = (inputFile) => { "node:process", "node:path", "strip-ansi", - "allure-js-commons/new", - "allure-js-commons/new/sdk/node", - "allure-js-commons/new/internal", + "allure-js-commons", + "allure-js-commons/sdk/node", + "allure-js-commons/internal", ]; return [ diff --git a/packages/newman-reporter-allure/src/index.ts b/packages/newman-reporter-allure/src/index.ts index 7bdc57b2d..787aa9812 100644 --- a/packages/newman-reporter-allure/src/index.ts +++ b/packages/newman-reporter-allure/src/index.ts @@ -10,7 +10,7 @@ import { MessageAllureWriter, Stage, Status, -} from "allure-js-commons/new/sdk/node"; +} from "allure-js-commons/sdk/node"; import { AllureNewmanConfig, PmItem, RunningItem } from "./model.js"; import { extractMeta } from "./utils.js"; diff --git a/packages/newman-reporter-allure/src/model.ts b/packages/newman-reporter-allure/src/model.ts index fc53d9117..3223a53d1 100644 --- a/packages/newman-reporter-allure/src/model.ts +++ b/packages/newman-reporter-allure/src/model.ts @@ -1,5 +1,5 @@ import { HeaderList, RequestBody } from "postman-collection"; -import { Config } from "allure-js-commons/new/sdk/node"; +import { Config } from "allure-js-commons/sdk/node"; export interface AllureNewmanConfig extends Omit { testMode?: boolean; diff --git a/packages/newman-reporter-allure/src/utils.ts b/packages/newman-reporter-allure/src/utils.ts index 5367a9c43..77be7d18b 100644 --- a/packages/newman-reporter-allure/src/utils.ts +++ b/packages/newman-reporter-allure/src/utils.ts @@ -1,5 +1,5 @@ import { EventList } from "postman-collection"; -import { Label, LabelName, allureIdRegexp, allureLabelRegexp } from "allure-js-commons/new/sdk/node"; +import { Label, LabelName, allureIdRegexp, allureLabelRegexp } from "allure-js-commons/sdk/node"; export const extractMeta = (eventList: EventList) => { const labels: Label[] = []; diff --git a/packages/newman-reporter-allure/test/spec/simple.test.ts b/packages/newman-reporter-allure/test/spec/simple.test.ts index 6d9caeea0..82d5cda2f 100644 --- a/packages/newman-reporter-allure/test/spec/simple.test.ts +++ b/packages/newman-reporter-allure/test/spec/simple.test.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/quotes */ import { afterAll, afterEach, beforeAll, expect, test } from "vitest"; -import { LabelName, Stage, Status } from "allure-js-commons/new/sdk/node"; +import { LabelName, Stage, Status } from "allure-js-commons/sdk/node"; import { server } from "../mocks/server"; import { runNewmanCollection } from "../utils"; diff --git a/packages/newman-reporter-allure/utils.ts b/packages/newman-reporter-allure/utils.ts index 95d511ae3..e811bea35 100644 --- a/packages/newman-reporter-allure/utils.ts +++ b/packages/newman-reporter-allure/utils.ts @@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto"; import { mkdir, rm, writeFile } from "node:fs/promises"; import { join } from "node:path"; import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons"; -import { LinkType } from "allure-js-commons/new/sdk/node" +import { LinkType } from "allure-js-commons/sdk/node" export type TestResultsByFullName = Record;