Skip to content

Conversation

@OlehBabenkoo
Copy link
Contributor

@OlehBabenkoo OlehBabenkoo commented Jun 30, 2025

Summary:

This PR introduces a new .todo functionality to both test and describe blocks, expanding the testing framework's capabilities to support marking tests or test groups as "to-do". These changes make it easier to track planned or incomplete tests while maintaining a clear overview of their status within test runs and reports. Additional improvements include UI updates to the HTML reporter, statistics tracking, and internal consistency updates.


Changelog:

Core Functionality Updates:
  1. Added .todo support:

    • test.todo(title): Marks an individual test as "to-do" for tracking purposes. These tests will not be executed but will appear in the test results as pending.
    • describe.todo(title): Marks an entire test group as "to-do". This is useful for planning feature-related tests that are not yet implemented.

    Example Usage:

    test.todo('Add validation for user input');
    describe.todo('User Authentication Tests', () => {
        test.todo('Test login functionality');
        test.todo('Test logout flow');
    });
  2. Updated test processing logic:

    • Modified the test and describe functions to handle a todo status.
    • For .todo tests/groups:
      • Body: Not executed.
      • Status Indicator: Added todo: true to the test/group object.
    • Updated statistics tracking:
      • Added a numTodo counter in result, which increments whenever a .todo is encountered.

Reporting Updates:
  1. Terminal Output:

    • Tests marked with .todo will appear in the terminal output labeled as TODO, highlighted with a yellow indicator (using ).
    • Example terminal output:
      ◦ Add validation for user input (TODO)
      ◦ Test login functionality (TODO)
      
  2. HTML Reporter:

    • Added a dedicated section for .todo tests in the report.
    • Adjustments to the HTML template include:
      • A new Todo statistics block.
      • Styling for .todo tests, using a yellow color scheme (#ff9800) to differentiate them visually from passed, failed, or skipped tests.
    • Updated test case rendering:
      • .todo tests display (TODO) next to their name in the report.

@VadimNastoyashchy VadimNastoyashchy self-requested a review June 30, 2025 16:27
@VadimNastoyashchy VadimNastoyashchy added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 30, 2025
@OlehBabenkoo OlehBabenkoo marked this pull request as ready for review July 1, 2025 15:40
@VadimNastoyashchy VadimNastoyashchy merged commit 905cfbe into scripterio-js:release/1.11.0 Jul 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants