diff --git a/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx b/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx index 21052c0793..5cd25f37de 100644 --- a/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx +++ b/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx @@ -56,9 +56,12 @@ const buildFileStructure = (row: CoverageTableRow) => { (acc: FileStructureObject, cur: CoverageTableRow) => { let path = cur.filename; if (row.path) { - path = path?.split(`${row.path}/`)[1]; + if (path) { + path = '/' + path; + } + path = path?.split(`/${row.path}/`)[1]; } - const pathArray = path?.split('/'); + const pathArray = path?.split('/').filter(el => el!==''); if (!pathArray) { return acc;