Skip to content

fix: emit suite names as TAP comments and use test.title instead of fullTitle#5904

Open
mostafaNazari702 wants to merge 1 commit into
mochajs:mainfrom
mostafaNazari702:fix/tap-suite-hierarchy-2410
Open

fix: emit suite names as TAP comments and use test.title instead of fullTitle#5904
mostafaNazari702 wants to merge 1 commit into
mochajs:mainfrom
mostafaNazari702:fix/tap-suite-hierarchy-2410

Conversation

@mostafaNazari702
Copy link
Copy Markdown
Contributor

@mostafaNazari702 mostafaNazari702 commented Apr 18, 2026

PR Checklist

Overview

So before, the TAP reporter was using test.fullTitle(), which basically stuffed the whole suite hierarchy into every single test name.

That made things kinda messy, and tools like tap-spec couldn’t really understand the structure properly. Everything just looked flat with long names.

Now it’s a bit smarter about it. When a suite starts, it prints the suite name as a comment line (kind of like how tape does it), and then each test just uses test.title. So instead of repeating the whole hierarchy over and over, you actually see the structure from those comment lines. Way cleaner and easier to follow.

@github-actions

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.74%. Comparing base (17ce208) to head (9f15a71).
⚠️ Report is 36 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5904      +/-   ##
==========================================
+ Coverage   89.69%   89.74%   +0.05%     
==========================================
  Files          66       66              
  Lines        4688     4692       +4     
  Branches      978      979       +1     
==========================================
+ Hits         4205     4211       +6     
+ Misses        483      481       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JoshuaKGoldberg JoshuaKGoldberg added the semver-major implementation requires increase of "major" version number; "breaking changes" label May 16, 2026
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tricky stuff! I looked over the TAP 13 specification and tried to map it to the changes & tests here. It seems to be good to me. I also asked Sonnet 4.6 to verify things and it's happy too. But I'm not a TAP user myself, so if anybody who actually uses it could weigh in at some point, that'd be nice.

We have to wait for a bit to merge anyway per #2410 (comment), so leaving this open but approved. Thanks & nice job! 👏

Comment thread lib/reporters/tap.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Non-Actionable] Just noting that this is TAP 12/13's informal convention of # SuiteName. TAP 14 is a whole other thing that Mocha's reporter doesn't try to support (yet?). This is fine.

@JoshuaKGoldberg JoshuaKGoldberg added the status: blocked Waiting for something else to be resolved label May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-major implementation requires increase of "major" version number; "breaking changes" status: blocked Waiting for something else to be resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug: TAP reporter doesn't adhere to spec

2 participants