From 7e3b782324490863735fb7161eeab62fb7c15b26 Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Sat, 10 Feb 2024 15:11:11 +0200 Subject: [PATCH] fix: artifact-test delay --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 90ebb0b..4575475 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,6 +36,7 @@ const listener: EnvironmentListenerFn = ({ testEvents }) => { function onTrackArtifact(artifact: any) { const $step = allure.$bind(); + const $$test = $test; const originalSave = artifact.doSave.bind(artifact); artifact.doSave = async (artifactPath: string, ...args: unknown[]) => { @@ -45,7 +46,7 @@ const listener: EnvironmentListenerFn = ({ testEvents }) => { const isVideo = !!inferMimeType({ sourcePath: artifactPath })?.startsWith('video/'); const handler = isDirectory ? zipHandler : isLog ? logHandler : 'copy'; const mimeType = isLog ? 'text/plain' : undefined; - const $allure = (isLog || isVideo ? $test : $step) ?? $step; + const $allure = (isLog || isVideo ? $$test : $step) ?? $step; $allure.fileAttachment(artifactPath, { name: path.basename(artifactPath),