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

Preserve pathname when linking to individual tests in HTML reporter #1464

Merged
merged 1 commit into from
Dec 11, 2014

Conversation

backspace
Copy link
Contributor

When I use Mocha in the browser in an Ember CLI application via ember-cli-mocha, the links to run individual tests are broken. The tests run from here: http://localhost:4200/tests

The test links look like this:

<a href="?grep=Edit%20an%20issue">Edit an issue</a>

Sadly, an href beginning with ? doesn’t link to a query on the current path, but instead to a query on the root. In the above example, it links to http://localhost:4200/?grep=Edit%20an%20issue.

I can click the link and put /tests back at the beginning of the path, but this patch would fix the links for me and anyone using Mocha with Ember CLI. The tests all still pass, I can’t imagine it having a negative impact anywhere.

@boneskull
Copy link
Contributor

@backspace You wouldn't happen to be using firefox, would you?

@boneskull boneskull added the status: waiting for author waiting on response from OP - more information needed label Dec 11, 2014
@backspace
Copy link
Contributor Author

I'm using Chrome. I failed to check it in other browsers, but my research indicates that linking to query parameters without a pathname links to the root instead of the current page.

@boneskull
Copy link
Contributor

OK, well I don't see an issue with this.

boneskull pushed a commit that referenced this pull request Dec 11, 2014
Preserve pathname when linking to individual tests in HTML reporter
@boneskull boneskull merged commit dc56c38 into mochajs:master Dec 11, 2014
@boneskull boneskull removed the status: waiting for author waiting on response from OP - more information needed label Dec 11, 2014
@ScottFreeCode ScottFreeCode mentioned this pull request Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants