Skip to content

Commit

Permalink
test_runner: fixes comments
Browse files Browse the repository at this point in the history
Adds missing returns.
Removes unnecessary regex replace in lcov reporter test
  • Loading branch information
philnash committed Oct 3, 2023
1 parent a2493a6 commit 88bc90c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/internal/test_runner/reporter/lcov.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ class LcovReporter extends Transform {
lcov += 'end_of_record\n';
}
} catch (error) {
callback(error);
return callback(error);
}
return callback(null, lcov);
}
callback(null);
return callback(null);
}
}

Expand Down
8 changes: 2 additions & 6 deletions test/fixtures/test-runner/output/lcov_reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ require('../../../common');
const fixtures = require('../../../common/fixtures');
const spawn = require('node:child_process').spawn;

const child = spawn(process.execPath,
['--no-warnings', '--experimental-test-coverage', '--test-reporter', 'lcov', fixtures.path('test-runner/output/output.js')],
{ stdio: 'pipe' });
// eslint-disable-next-line no-control-regex
child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, '')));
child.stderr.pipe(process.stderr);
spawn(process.execPath,
['--no-warnings', '--experimental-test-coverage', '--test-reporter', 'lcov', fixtures.path('test-runner/output/output.js')], { stdio: 'inherit' });

0 comments on commit 88bc90c

Please sign in to comment.