From 2ee90a0f0404bae43527f18ed0e29c63386f1c49 Mon Sep 17 00:00:00 2001 From: "Li,Jiahao" Date: Wed, 25 Sep 2024 14:44:42 +0800 Subject: [PATCH] fix: lookup source from inline sourcemaps (#1307) --- index.js | 3 ++- lib/source-maps.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3ebf3555c..598838eb3 100755 --- a/index.js +++ b/index.js @@ -450,7 +450,8 @@ class NYC { const context = libReport.createContext({ dir: this.reportDirectory(), watermarks: this.config.watermarks, - coverageMap: await this.getCoverageMapFromAllCoverageFiles() + coverageMap: await this.getCoverageMapFromAllCoverageFiles(), + sourceFinder: this.sourceMaps.sourceFinder }) this.reporter.forEach((_reporter) => { diff --git a/lib/source-maps.js b/lib/source-maps.js index 8a3914cdf..b563bc3a9 100644 --- a/lib/source-maps.js +++ b/lib/source-maps.js @@ -14,6 +14,7 @@ class SourceMaps { this.cacheDirectory = opts.cacheDirectory this.loadedMaps = {} this._sourceMapCache = libSourceMaps.createSourceMapStore() + this.sourceFinder = this._sourceMapCache.sourceFinder } cachedPath (source, hash) {