Skip to content

🐛 Bug: suite/test links for HTML reporter may hit unrelated tests #5232

@danny0838

Description

@danny0838

Bug Report Checklist

  • I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
  • I have searched for related issues and issues with the faq label, but none matched my issue.
  • I have 'smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, my usage of Mocha, or Mocha itself.
  • I want to provide a PR to resolve this

Expected

  1. Click on the link for Case1 => should run only the test Case1 test1
  2. Click on the link for CSS => should run only the test CSS

Actual

  1. Click on the link for Case1 => Case1 test1 and Case10 test1 are run
  2. Click on the link for CSS => CSS and should fix invalid CSS are run

Minimal, Reproducible Example

Create a web page with following tests:

describe('Case1', function () {
  it('test1', function () {
    /* do something */
  });
});

describe('Case10', function () {
  it('test1', function () {
    /* do something */
  });
});

it('CSS', function () {
  /* do something */
});

it('should fix invalid CSS', function () {
  /* do something */
});
  1. Click on the link for Case1.
  2. Click on the link for CSS.

Versions

mocha 10.7.3

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: browserbrowser-specificstatus: accepting prsMocha can use your help with this one!type: buga defect, confirmed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions