Defines a client for testing REST API endpoints.
api-testing
api-testing
Provides factory functions for action API clients ("users").
api-testing
Implements a client for testing action API modules.
api-testing
Provides an extended version of the Chai assert library, with added convenience methods.
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.
api-testing
Provides access to test configuration.
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.
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.
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.
api-testing
Sets a configuration value. The new configuration will be reflected by the proxy object returned by the main function.
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.
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.
api-testing
Initializes the config to dummy values, for testing. The dummy values will not be functional and need to be replaced before use.
api-testing
Provides utilities for API testing.
api-testing
Provides basic wiki-wide functionality.
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.
api-testing
Runs some pending jobs.
api-testing
Returns a promise that will resolve when all jobs in the wiki's job queue have been run.