Skip to content

Commit eb70de7

Browse files
albertywmantoni
authored andcommitted
Remove dependency on removed nyc feature
1 parent b039a55 commit eb70de7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/chromium.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,19 @@ module.exports = function (b, opts) {
126126
return;
127127
}
128128
if (text.indexOf('[COVERAGE ') === 0) {
129-
if (process.env.NYC_ROOT_ID) {
130-
var nycConfig = JSON.parse(process.env.NYC_CONFIG);
131-
var json = text.substring(10, text.length - 1);
132-
var file = path.join(nycConfig.tempDir,
133-
process.env.NYC_ROOT_ID + '.json');
134-
fs.writeFile(file, json, 'utf8', function (err) {
135-
if (err) {
136-
b.emit('error', err);
137-
}
138-
});
139-
return;
129+
var nycRootID = process.env.NYC_ROOT_ID;
130+
if (!nycRootID) {
131+
// NYC >v15 does not export a NYC_ROOT_ID so use a "random" uuid instead
132+
nycRootID = '4638ceac-c8d9-411d-9e1f-72755846a221';
140133
}
141-
output.write('Coverage information received, but no nyc\n');
134+
var nycConfig = JSON.parse(process.env.NYC_CONFIG);
135+
var json = text.substring(10, text.length - 1);
136+
var file = path.join(nycConfig.tempDir, nycRootID + '.json');
137+
fs.writeFile(file, json, 'utf8', function (err) {
138+
if (err) {
139+
b.emit('error', err);
140+
}
141+
});
142142
return;
143143
}
144144
if (text.indexOf('[EXIT ') === 0) {

0 commit comments

Comments
 (0)