From c7d0caaee9cfe928d508e42ebfd0bc5d7842ad09 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Mon, 6 Jun 2022 11:48:25 +0200 Subject: [PATCH] Show errors thrown while loading a coverage file This will save a good amount of time for anyone dealing with a badly formatted JSON file. --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 3ebf3555..9dfc9f93 100755 --- a/index.js +++ b/index.js @@ -515,6 +515,7 @@ class NYC { await this.sourceMaps.reloadCachedSourceMaps(report) return report } catch (error) { + console.error(`There was a problem loading coverage from ${filename} in ${baseDirectory}: ${error}`) return {} } }