Skip to content

Commit

Permalink
Remove dependency on removed nyc feature
Browse files Browse the repository at this point in the history
  • Loading branch information
albertyw authored and mantoni committed May 23, 2021
1 parent b039a55 commit eb70de7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/chromium.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,19 @@ module.exports = function (b, opts) {
return;
}
if (text.indexOf('[COVERAGE ') === 0) {
if (process.env.NYC_ROOT_ID) {
var nycConfig = JSON.parse(process.env.NYC_CONFIG);
var json = text.substring(10, text.length - 1);
var file = path.join(nycConfig.tempDir,
process.env.NYC_ROOT_ID + '.json');
fs.writeFile(file, json, 'utf8', function (err) {
if (err) {
b.emit('error', err);
}
});
return;
var nycRootID = process.env.NYC_ROOT_ID;
if (!nycRootID) {
// NYC >v15 does not export a NYC_ROOT_ID so use a "random" uuid instead
nycRootID = '4638ceac-c8d9-411d-9e1f-72755846a221';
}
output.write('Coverage information received, but no nyc\n');
var nycConfig = JSON.parse(process.env.NYC_CONFIG);
var json = text.substring(10, text.length - 1);
var file = path.join(nycConfig.tempDir, nycRootID + '.json');
fs.writeFile(file, json, 'utf8', function (err) {
if (err) {
b.emit('error', err);
}
});
return;
}
if (text.indexOf('[EXIT ') === 0) {
Expand Down

0 comments on commit eb70de7

Please sign in to comment.