Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9aa0ac6

Browse filesBrowse files
authored
fix(cypress): process links when patterns config isn't present (fixes #900, via #902)
1 parent 34d7cef commit 9aa0ac6
Copy full SHA for 9aa0ac6

File tree

1 file changed

+8
-5
lines changed
Filter options

1 file changed

+8
-5
lines changed

‎packages/allure-cypress/src/reporter.ts

Copy file name to clipboardExpand all lines: packages/allure-cypress/src/reporter.ts
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ export const allureCypress = (on: Cypress.PluginEvents, config?: AllureCypressCo
7575
}
7676

7777
if (type === MessageType.METADATA) {
78-
const { parameter, links, attachments, ...metadata } = payload;
78+
const { parameter = [], links = [], attachments, ...metadata } = payload;
7979
const currentStep = currentSteps[currentSteps.length - 1];
8080

81-
parameter?.forEach(({ name, value, excluded, mode }) => {
81+
parameter.forEach(({ name, value, excluded, mode }) => {
8282
currentTest.parameter(name, value, {
8383
excluded,
8484
mode,
@@ -90,12 +90,15 @@ export const allureCypress = (on: Cypress.PluginEvents, config?: AllureCypressCo
9090
(currentStep || currentTest).addAttachment(attachment.name, attachment.type, attachmentName);
9191
});
9292

93-
if (!config?.links?.length || !links?.length) {
94-
currentTest.applyMetadata(metadata);
93+
if (!config?.links?.length) {
94+
currentTest.applyMetadata({
95+
...metadata,
96+
links,
97+
});
9598
return;
9699
}
97100

98-
const formattedLinks: Link[] = links?.map((link) => {
101+
const formattedLinks: Link[] = links.map((link) => {
99102
const matcher = config?.links?.find?.((item) => item.type === link.type);
100103

101104
if (!matcher || link.url.startsWith("http")) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.