Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce custom reporters (poku, dot, compact, focus, verbose, and classic) #921

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

wellwelwel
Copy link
Owner

@wellwelwel wellwelwel commented Jan 23, 2025

Closes #629.


🚧 WIP: This is probably the most significant refactoring of the entire project.

This PR introduces 6 reporters:

  • poku (default):
    • logs all describe, it, test and assert titles and messages, including their modifiers.
    • logs only the file name for errors during the execution, then lists all logs for each failed file at the running end.
  • dot (inspired by Mocha):
    • logs a dot for each success file test and F for each failed file.
    • lists all logs for each failed file at the running end.
  • compact (inspired by modern Tap):
    • lists only file paths with PASS or FAIL and, in case of failures, lists all logs for each failed file at the running end.
  • focus:
    • Logs only errors (in real time). If there is no error, it just logs a small footnote resume.
  • verbose:
    • just like the default (poku), but logs errors in real time and also at the running end.
  • classic:
    • The standard report style from version 2 to preserve our history 🐷

⏳ Progress:

  • CLI
  • API
  • Config File

Note

I intend to expose the plugin to allow external reporters to be created, but I think it would be interesting to decouple this responsibility into its own PR.

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 99.81308% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.27%. Comparing base (c0845fe) to head (1abbf64).

Files with missing lines Patch % Lines
src/services/reporters/poku.ts 99.46% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #921      +/-   ##
==========================================
+ Coverage   99.04%   99.27%   +0.22%     
==========================================
  Files          37       47      +10     
  Lines        1884     2337     +453     
  Branches       12       13       +1     
==========================================
+ Hits         1866     2320     +454     
+ Misses          9        8       -1     
  Partials        9        9              
Flag Coverage Δ
linux 99.14% <99.81%> (+0.25%) ⬆️
osx 99.18% <99.81%> (+0.24%) ⬆️
windows 97.98% <99.81%> (-0.95%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make output report customizable
1 participant