Skip to content

Commit

Permalink
fix jasmine full name generation
Browse files Browse the repository at this point in the history
  • Loading branch information
baev committed Aug 19, 2024
1 parent d45c0d9 commit bb53688
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/allure-jasmine/src/testplan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const getIndexedTestPlan = (): TestPlanIndex | undefined => {
}
};

const isInTestPlan = (testplan: TestPlanIndex | undefined, fullName: string, labels: readonly Label[]) => {
const isInTestPlan = (testplan: TestPlanIndex | undefined, fullName: string | undefined, labels: readonly Label[]) => {
if (testplan && !testplan.fullNames.has(fullName)) {
const allureId = labels.find((l) => l.name === LabelName.ALLURE_ID)?.value;
return allureId && testplan.ids.has(allureId);
Expand Down
7 changes: 4 additions & 3 deletions packages/allure-jasmine/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { cwd } from "node:process";
import { extractMetadataFromString } from "allure-js-commons/sdk";
import { getRelativePath } from "allure-js-commons/sdk/reporter";
import { getPosixPath } from "allure-js-commons/sdk/reporter";

import FailedExpectation = jasmine.FailedExpectation;

Expand All @@ -22,13 +23,13 @@ export const getAllureNamesAndLabels = (
suites: readonly string[],
rawSpecName: string,
) => {
const filePart = (filename || "").replace(cwd(), "").replace(/^[/\\]/, "");
const filePart = filename ? getPosixPath(getRelativePath(filename)) : undefined;
const { cleanTitle: specName, labels } = extractMetadataFromString(rawSpecName);
const specPart = [...suites, specName].join(" > ");

return {
name: specName,
fullName: `${filePart}#${specPart}`,
fullName: filePart ? `${filePart}#${specPart}` : undefined,
labels,
};
};

0 comments on commit bb53688

Please sign in to comment.