diff --git a/packages/ember-cli-code-coverage/lib/attach-middleware.js b/packages/ember-cli-code-coverage/lib/attach-middleware.js index 421c56c5..35211b62 100644 --- a/packages/ember-cli-code-coverage/lib/attach-middleware.js +++ b/packages/ember-cli-code-coverage/lib/attach-middleware.js @@ -69,11 +69,16 @@ function adjustCoverageKey( modifyAssetLocation ) { let relativePath = path.relative(root, filepath); + let embroiderTmpPathRegex = /embroider\/.{6}/gm; // we can determine if file is coming from embroider based on how the path looks if (embroiderTmpPathRegex.test(filepath)) { relativePath = normalizeRelativePath(root, filepath); + } else if (relativePath.startsWith('..')) { + // This lives in a directory outside of the current one, likely a monorepo. + // In this case we can assume that the original path is correct. + return filepath; } let namespace = relativePath.split(path.sep)[0];