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

test_runner: add level-based diagnostic handling for reporter #55964

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Commits on Nov 23, 2024

  1. test_runner: add level parameter to reporter.diagnostic

    Added a parameter to allow severity-based formatting for
    diagnostic messages. Defaults to 'info'.
    This update enables better control over message presentation
    (e.g., coloring) based on severity levels such as 'info', 'warn',
    and 'error'.
    
    Refs: nodejs#55922
    hpatel292-seneca committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    7dda539 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2024

  1. test_runner: enhance #handleEvent to handle levels

    Updated to process the parameter for events. Messages
    are now formatted with colors based on the
    (e.g., 'info', 'warn', 'error').
    This change ensures diagnostic messages are visually distinct,
    improving clarity and reducing debugging effort during test runs.
    
    Refs: nodejs#55922
    hpatel292-seneca committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    c618874 View commit details
    Browse the repository at this point in the history
  2. test_runner: extend reporterColorMap for levels

    Enhanced  to include colors for the following
    diagnostic levels:
     : blue - info
     : yellow - warn
     : red - error
    
    Refs: nodejs#55922
    hpatel292-seneca committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    2ac841c View commit details
    Browse the repository at this point in the history
  3. test_runner: set level for coverage threshold

    Updated coverage threshold checks in to use the
    parameter when calling. Errors now use the
    'error' level for red-colored formatting.
    This ensures coverage errors are highlighted effectively in the output.
    
    Fixes: nodejs#55922
    hpatel292-seneca committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    1ca0d45 View commit details
    Browse the repository at this point in the history
  4. test_runner: remove debug from reporterColorMap

    implemented requested change by removing debug
    from reporterColorMap
    
    Refs: nodejs#55964 (review)
    hpatel292-seneca committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    038b0f8 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2024

  1. doc: update 'test:diagnostic' event to include level parameter

    updated the documentation for the 'test:diagnostic' event to
    include the new level parameter. clarified its purpose, default
    value, and possible severity levels ('info', 'warn',
    'error').
    
    Fixes: nodejs#55922
    hpatel292-seneca committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    b490d9d View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2024

  1. test: add test for spec reporter red color output

    Add a test in  to verify that
    the diagnostic error messages about unmet coverage thresholds
    are displayed in red when using the spec reporter.
    
    Fixes: nodejs#55922
    hpatel292-seneca committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    3e4d5e6 View commit details
    Browse the repository at this point in the history
  2. test: disable no-control-regex for color regex

    Added eslint-disable comment to bypass no-control-regex.
    This allows testing ANSI escape sequences for red color
    in error messages without triggering lint errors.
    
    Fixes: nodejs#55922
    hpatel292-seneca committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    4048621 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2024

  1. doc: clarify diagnostic behavior in API docs

    Updated the description of the  parameter to note
    that color output is specific to the spec reporter. This
    helps users understand its behavior and create custom
    reporters with accurate expectations.
    
    Fixes: nodejs#55922
    hpatel292-seneca committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    33b961d View commit details
    Browse the repository at this point in the history