jest-allure2-reporter
Version:
Idiomatic Jest reporter for Allure Framework
18 lines (12 loc) • 504 B
text/typescript
import path from 'node:path';
import type { KeyedHelperCustomizer } from 'jest-allure2-reporter';
import { FileNavigatorCache } from '../../../utils';
export const getFileNavigator: KeyedHelperCustomizer<'getFileNavigator'> = () => {
const cache = FileNavigatorCache.instance;
return (maybeSegmentedFilePath) => {
const filePath = Array.isArray(maybeSegmentedFilePath)
? maybeSegmentedFilePath.join(path.sep)
: maybeSegmentedFilePath;
return cache.resolve(filePath);
};
};