As headless QUnit tests are adopted throughout the WMF we are creating multiple bespoke test runners. Before this gets out of control let's fold the Node.js QUnit functionality into the mw-node-qunit library and share the maintenance burden.
During code review of the Hygiene: introduce headless QUnit tests a couple of us were surprised to see qunit listed in package.json of MobileFrontend, given that Popups uses node-qunit which provides a wrapper around qunit and some of the scaffolding e.g. MockMediaWiki that now lives inside MobileFrontend.
Stephen later explained mw-node-qunit adds jsdom, sinon, and wraps QUnit and since @Jhernandez wrote it and the team is not familiar with it we may want to revisit it.
Possible options down the road include
- Spinning out wikimedia/mock-mediawiki for handling MediaWiki dependencies
- Use qunit in all extensions using webpack
- Expanding/adapting mw-node-qunit
Related tasks: T212521
- Use of headless qunit runner is consistent between Popups and MobileFrontend
- Tests should gate merging. This is currently the case for Popups but not headless tests in MobileFrontend.