Page MenuHomePhabricator

Get Jest to run in PageTriage continuous integration
Closed, ResolvedPublic

Description

Get Jest (JavaScript unit test library) to run in PageTriage continuous integration

Now that https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageTriage/+/910002 (make jest available for unit tests) is merged.

Related to T334642: Investigate switching Javascript unit tests from QUnit to Jest [12hrs]

The documentation at https://www.mediawiki.org/wiki/Continuous_integration/Tutorials/Adding_a_MediaWiki_extension#Editing_Zuul_configuration may be helpful. Looks like a patch may be needed for integration/config -> zuul/layout.yaml

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I think most extensions handle this by updating the package.json to look like this:

"scripts": {
		"test": "grunt test && npm run jest",
		"jest": "jest",
	},

But since jest currently exits with error code 1 (no tests) we would need to wait before doing that.

EDIT: We could change the jest definition to jest --passWithNoTests" and then it should start to work in CI, and as tests are added, they should run.

jsn.sherman changed the task status from Open to In Progress.Jun 20 2023, 1:43 PM
jsn.sherman moved this task from Ready to Eng review on the Moderator-Tools-Team (Kanban) board.