processLinks.test.js is the only qunit test on Page-Previews that doesn't run in node-qunit.
Let's migrate it to run in node-qunit so that we only have one suite of unit tests to run when developing.
- Test is written in a test-case manner, heavily depending on mw libraries that require a running mediawiki
- mw.Regex.escape can be stubbed
- mw.Uri depends on mw.template, hard to stub
- mw.Title depends on correct mw.config values, very hard to stub
My take would be to change the tests to be unit tests instead of integration tests, and verify via stubs that Regex, Uri and Title are called correctly escape and parse links, and remove the test-case approach.
Maybe add a browser test with a few of the test-case links for having an integration test.
- All qunit tests are now node-qunit
- processLinks remains well tested
- The "qunit" Grunt task is removed along with the grunt-qunit dependency