Expand all

api-testing

Defines a client for testing REST API endpoints.

Expand all

api-testing

Provides factory functions for action API clients ("users").

Expand all

api-testing

Implements a client for testing action API modules.

Expand all

api-testing

Provides an extended version of the Chai assert library, with added convenience methods.

Expand all

api-testing

Factory for retrieving a supertest agent to call the action API or the REST Api. Using the same agent allows us to emulate the same user hitting both APIs as a single, logged in user.

Expand all

api-testing

Provides access to test configuration.

Expand all

api-testing

Load the config from the given file. Returns a config proxy object that, for now, reflects the content of the file. However, the state of that object will change when the configuration is changed by calling load() again, or by calling set() or fake(), etc. The object return by the main function is the same proxy object returned by this function.

Expand all

api-testing

Initialize the config data. If a config data was already loaded or otherwise defined, this does nothing. If no config is known so far, this function detects the location of the config file and loads it. The location can be set using the API_TESTING_CONFIG_FILE environment variable. Otherwise, the config will is expected to be placed in the base directory.

Expand all

api-testing

Replace the configuration. The new configuration will be reflected by the proxy object returned by the main function. The configuration will be copied, so changes made to cfg later will not have an effect.

Expand all

api-testing

Sets a configuration value. The new configuration will be reflected by the proxy object returned by the main function.

Expand all

api-testing

Resets the configuration (for testing). This allows to main function to detect the config file again, instead of just returning whatever config was already defined.

Expand all

api-testing

Sets the base directory for locating the config file (for testing). Should be used together with reset() when testing the behavior of the main function.

Expand all

api-testing

Initializes the config to dummy values, for testing. The dummy values will not be functional and need to be replaced before use.

Expand all

api-testing

Provides utilities for API testing.

Expand all

api-testing

Provides basic wiki-wide functionality.

Expand all

api-testing

Returns a supertest agent for making calls to MediaWiki. If the config has a factory callback set, it will be used to create the superagent instance. Otherwise, this will create a superagent that points to the MediaWiki instance located at the base_uri defined in the config.

Expand all

api-testing

Runs some pending jobs.

Expand all

api-testing

Returns a promise that will resolve when all jobs in the wiki's job queue have been run.