Skip to content

summaryReporter doesn't print main testSuite when there are nested testSuites #2810

Open
@gian1200

Description

@gian1200

Given:

  • src/index.spec.ts
describe('a test suite', () => {
  it('should pass', () => {
    expect(true).toBeTrue();
  });
  it('should fail', () => {
    expect(true).toBeFalse();
  });

  describe('an inner test suite', () => {
    it("should pass 2", () => {
      expect(undefined).toBeUndefined();
    });
    it("should fail 2", () => {
      expect(undefined).toBeTrue();
    });

    describe('another inner test suite', () => {
      it("should pass 3", () => {
        expect(null).toBeNull();
      });
      it("should fail 3", () => {
        expect(null).toBeTrue();
      });
    });
  });
});

Expected:

image

Actual:

image

Quick Analysis:

Seems to work by calling logSuite instead of logResults, in line 97

reportTestFileResults({ logger, sessionsForTestFile }) {
cachedLogger = logger;
for (const session of sessionsForTestFile) {
logResults(logger, session.testResults, '', session.browser);
logger.log('');
}
reportBrowserLogs(logger, sessionsForTestFile);
},

However, not sure if it's expected to have the browser name on all testSuite lines, or only the root one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions