While working on https://phabricator.wikimedia.org/T353187 we found that there are error scenarios where a Codex component is not listed in the module definition file that we would like to provide helpful custom error messages for. The scope of this ticket is to test those error handling scenarios in CodexModuleTest.php.
Example scenarios where a Codex component is required:
const { CdxButton } = require( './codex.js' );
And:
- The codexComponents key is defined, and there are other components listed, but not CdxButton
- The codexComponents key is defined, and there are no components listed (an empty array)
The codexComponents key is not defined(This scenario is not handled because there is a valid case where a user may use themeStyles and not require codexComponents to be defined)