Extension:GrowthExperiments/Technical documentation/Frontend

Client modules map
Disclaimer: the table is not updated since May 2022

Unit testing
The GrowthExperiments extension client code can and should be tested with one of MediaWiki's preferred runners: jest or qunit. Specifically Jest is used for running Vue components unit tests and QUnit for running other Javascript scripts. QUnit tests live under the folder  whereas Jest tests are normally placed in source directories by the side of the script they are testing. The current CI setup (tbd: add reference to doc/sources) will execute both kinds of tests whenever a change is pushed to gerrit. Sadly there's not a single command (yet) to run them all from a developer environment.

QUnit
For running QUnit tests use  from the root mediawiki directory.

Jest
For running Jest tests use the NPM script  from the GrowthExperiments extension directory.

Snapshot testing
Jest supports snapshot testing which is a useful feature to make sure UIs do not change unexpectedly. To create a snapshot file from a component for the first time use. To update an existing snapshot based on source component changes use