This is an epic to track the Moderator-Tools-Team work to improve testing coverage in Javascript files in the PageTriage extension. Subtasks will primarily be on a per-module basis.
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Add QUnit test for copypatrol URL | mediawiki/extensions/PageTriage | master | +39 -9 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | Samwalton9-WMF | T334506 Improve Javascript testing coverage in PageTriage | |||
| Resolved | Spike | jsn.sherman | T334642 Investigate switching Javascript unit tests from QUnit to Jest [12hrs] | ||
| Resolved | Samwalton9-WMF | T340112 PageTriage: Add example jest smoke test for curation toolbar |
Event Timeline
Change 910855 had a related patch set uploaded (by DannyS712; author: Novem Linguae):
[mediawiki/extensions/PageTriage@master] Add QUnit test for copypatrol URL
Change 910855 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Add QUnit test for copypatrol URL
Coverage is now being logged and under 10%. I'm excited to see it improve as the codebase evolves! https://gerrit.wikimedia.org/r/918508
@Jdlrobson Is there a code coverage GUI somewhere to check out the front end coverage in detail? I found https://doc.wikimedia.org/cover-extensions/PageTriage/ but I think that's PHP only. Thanks for your work on this ticket.
I don't believe it's published anywhere right now but it can be.
If you run npm run jest it will create coverage/lcov-report/index.html
which you can open in your browser.
I think if you change the output directory to docs, and also add it to the npm run doc command it should appear magically at docs.wikimedia.org
Edit: You can use https://jestjs.io/docs/cli#--coveragedirectorypath to output coverage to the docs folder.
Thanks. Doesn't look too hard. I've made a ticket at T339799: Add Jest code coverage report somewhere.
If you do something like this patch to Popups you should be able to get the JS coverage report in SonarQube at https://sonarcloud.io/component_measures?id=mediawiki-extensions-PageTriage&metric=new_coverage&view=list
Given that we're wrapping up our time dedicated on PageTriage, this tracking task is effectively resolved.