UNPKG

jest-allure2-reporter

Version:
18 lines (12 loc) 504 B
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); }; };