FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: restore HTML JavaScript test suite by fly1d · Pull Request #2272 · coveragepy/coveragepy · GitHub

test: restore HTML JavaScript test suite - #2272

Open
fly1d wants to merge 1 commit into
coveragepy:mainfrom
fly1d:codex/restore-js-tests
Open

test: restore HTML JavaScript test suite#2272
fly1d wants to merge 1 commit into
coveragepy:mainfrom
fly1d:codex/restore-js-tests

Conversation

fly1d commented Aug 26, 2026

Copy link
Copy Markdown

In #2257, Ned asked for a separate PR to get coverage.py's JavaScript tests working again. The suite was stopping before it could run because tests/js/index.html still loaded local jQuery and template files that have been removed from the repository.

This PR:

  • updates the fixture to match the current generated pyfile markup (p > span.n > a);
  • replaces the jQuery/template helpers with native DOM APIs;
  • removes the stale local asset references; and
  • fixes the existing to_prev_chunk() boundary case where the previous highlighted chunk starts on line 1. Restoring the existing tests exposed that early return; the normal selection behavior is unchanged.

This is intentionally separate from the percentage calculation work in #2257 and #2259.

Verification

  • Browser QUnit suite: 96 tests, 253 assertions, 0 failures, with no console errors or warnings.
  • python -m pytest -n 0 tests/test_html.py -q (67 passed).
  • node --check tests/js/tests.js.
  • node --check coverage/htmlfiles/coverage_html.js.
  • pre-commit run --all-files.
  • git diff --check.

OpenAI Codex assisted with the implementation and verification of this change.

Update the QUnit fixture to match the current pyfile markup and remove references to deleted jQuery assets. Replace the old jQuery helpers with native DOM APIs so the existing navigation assertions run again.

Restoring the suite also exposes a boundary error in to_prev_chunk when the previous highlighted chunk starts on line 1; fix that case while preserving the existing selection behavior.

OpenAI Codex assisted with the implementation and verification of this change.

yangfan-yf-yf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I rechecked d174051. The fixture matches the current p > span.n > a markup, the native DOM helpers preserve the existing assertions, and the previous-chunk scan correctly retains a chunk beginning on line 1.

In a local Chromium run, the QUnit page completed 96 tests / 253 assertions with no failures or console warnings. On Windows with Python 3.12, tests/test_html.py completed with 66 passed and one platform-specific skip. Both JavaScript syntax checks and git diff --check passed.

The repository checks currently do not execute tests/js; adding a headless entry point would be a useful follow-up, as would removing the now-unreferenced tests/qunit/jquery.tmpl.min.js. Neither affects the requested suite restoration or boundary fix.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL