Skip to content

🐛 Bug: test links in the browser reporter keep the original fgrep and invert params #5102

@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

A link of the browser reporter should remove fgrep and invert parameters in the original URL.

Actual

A link of the browser reporter keeps the original fgrep and invert parameters in the original URL.

Minimal, Reproducible Example

  1. Create a test page like:
<!DOCTYPE html>
<meta charset="UTF-8">
<link rel="stylesheet" href="mocha.css">
<div id="mocha"></div>
<script src="mocha.js"></script>
<script>
mocha.setup('bdd');

describe('tests', function () {
  it('test1', function () {});
  it('test2', function () {});
});

mocha.run();
</script>
  1. Open the page in the browser.

  2. Append ?fgrep=tests in the address and visit it.

  3. Wait for the test to complete, and click the replay link of test1.

Versions

mocha@10.3.0 in javascript ES2018

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: 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