Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: address bug when running with coverage enabled
  • Loading branch information
bcoe committed Oct 5, 2019
commit afcef58d396a936a8010014945fa2c756f16a476
12 changes: 9 additions & 3 deletions test/parallel/test-source-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,15 @@ function nextdir() {
function getSourceMapFromCache(fixtureFile, coverageDirectory) {
const jsonFiles = fs.readdirSync(coverageDirectory);
for (const jsonFile of jsonFiles) {
const maybeSourceMapCache = require(
path.join(coverageDirectory, jsonFile)
)['source-map-cache'] || {};
let maybeSourceMapCache;
try {
maybeSourceMapCache = require(
path.join(coverageDirectory, jsonFile)
)['source-map-cache'] || {};
} catch (err) {
console.warn(err);
maybeSourceMapCache = {};
}
const keys = Object.keys(maybeSourceMapCache);
for (const key of keys) {
if (key.includes(fixtureFile)) {
Expand Down