jest-allure2-reporter
Version:
Idiomatic Jest reporter for Allure Framework
11 lines (8 loc) • 347 B
text/typescript
import path from 'node:path';
import type { FileAttachmentHandler } from '../types';
import { getFileSize } from '../../utils';
export const referenceHandler: FileAttachmentHandler = async (context) => {
const source = path.resolve(context.sourcePath);
const size = context.size ?? (await getFileSize(source));
return { source, size };
};