Skip to content

Commit

Permalink
fixed indentation and lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mihir254 committed May 5, 2024
1 parent 9075994 commit 38766cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions lib/internal/test_runner/reporter/dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
MathMax,
} = primordials;
const colors = require('internal/util/colors');
const { formatTestReport, indent } = require('internal/test_runner/reporter/utils');
const { formatTestReport } = require('internal/test_runner/reporter/utils');

module.exports = async function* dot(source) {
let count = 0;
Expand All @@ -30,9 +30,7 @@ module.exports = async function* dot(source) {
if (failedTests.length > 0) {
yield `\n${colors.red}Failed tests:${colors.white}\n\n`;
for (const test of failedTests) {
const indentation = indent(test.nesting);
const formattedReport = formatTestReport('test:fail', test, '', indentation, false);
yield formattedReport;
yield formatTestReport('test:fail', test);
}
}
};
Expand Down
10 changes: 5 additions & 5 deletions test/parallel/test-runner-reporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('node:test reporters', { concurrency: true }, () => {
it('should default destination to stdout when passing a single reporter', async () => {
const child = spawnSync(process.execPath, ['--test', '--test-reporter', 'dot', testFile]);
assert.strictEqual(child.stderr.toString(), '');
assert.match(child.stdout.toString(), /.XX.\n/);
assert.match(child.stdout.toString(), /\.XX\.\n/);
assert.match(child.stdout.toString(), /Failed tests:/);
assert.match(child.stdout.toString(), /βœ– failing/);
assert.match(child.stdout.toString(), /βœ– nested/);
Expand All @@ -47,7 +47,7 @@ describe('node:test reporters', { concurrency: true }, () => {
const child = spawnSync(process.execPath,
['--test', '--test-reporter', 'dot', '--test-reporter-destination', 'stdout', testFile]);
assert.strictEqual(child.stderr.toString(), '');
assert.match(child.stdout.toString(), /.XX.\n/);
assert.match(child.stdout.toString(), /\.XX\.\n/);
assert.match(child.stdout.toString(), /Failed tests:/);
assert.match(child.stdout.toString(), /βœ– failing/);
assert.match(child.stdout.toString(), /βœ– nested/);
Expand All @@ -56,7 +56,7 @@ describe('node:test reporters', { concurrency: true }, () => {
it('should support stderr as a destination', async () => {
const child = spawnSync(process.execPath,
['--test', '--test-reporter', 'dot', '--test-reporter-destination', 'stderr', testFile]);
assert.match(child.stderr.toString(), /.XX.\n/);
assert.match(child.stderr.toString(), /\.XX\.\n/);
assert.match(child.stderr.toString(), /Failed tests:/);
assert.match(child.stderr.toString(), /βœ– failing/);
assert.match(child.stderr.toString(), /βœ– nested/);
Expand All @@ -70,7 +70,7 @@ describe('node:test reporters', { concurrency: true }, () => {
assert.strictEqual(child.stderr.toString(), '');
assert.strictEqual(child.stdout.toString(), '');
const fileContents = fs.readFileSync(file, 'utf8');
assert.match(fileContents, /.XX.\n/);
assert.match(fileContents, /\.XX\.\n/);
assert.match(fileContents, /Failed tests:/);
assert.match(fileContents, /βœ– failing/);
assert.match(fileContents, /βœ– nested/);
Expand All @@ -95,7 +95,7 @@ describe('node:test reporters', { concurrency: true }, () => {
assert.match(child.stdout.toString(), /TAP version 13/);
assert.match(child.stdout.toString(), /# duration_ms/);
const fileContents = fs.readFileSync(file, 'utf8');
assert.match(fileContents, /.XX.\n/);
assert.match(fileContents, /\.XX\.\n/);
assert.match(fileContents, /Failed tests:/);
assert.match(fileContents, /βœ– failing/);
assert.match(fileContents, /βœ– nested/);
Expand Down

0 comments on commit 38766cf

Please sign in to comment.