Loads a destination matching the provided alias stored in systems.json
and credentials.json
.
By default, this function starts looking in the directory the test process has been started in (i.e. '.')
and traverses the file hierarchy upwards until it finds a systems.json and credentials.json file.
Alternatively, you can supply paths to the systems and the credentials file directly.
Throws an error when no systems.json can be found, the alias does not match any of the available destinations, the JSON is malformed or one of the supplied paths is invalid. Does not throw an error when no credentials.json can be found, but will print a warning.
The alias identifying the destination
References to the systems.json
and credentials.json
files
An array of destinations
Loads all destinations stored in systems.json
and credentials.json
files.
By default, this functions starts looking in the directory the test process has been started in (i.e. '.') and traverses the file hierarchy upwards until it finds a systems.json and credentials.json file. Alternatively, you can supply paths to the systems and the credentials file directly.
Throws an error when no systems.json can be found, the JSON is malformed or one of the supplied paths is invalid. Does not throw an error when no credentials.json can be found, but will print a warning.
References to the systems.json
and credentials.json
files
An array of destinations
Add all destinations from the systems.json
and credentials.json
files to the destinations
environment variable.
Throws an error if a destination with the same name as the given test destinations already exists.
References to the systems.json
and credentials.json
files
Add a destination with the given name from the systems.json
and credentials.json
files to the destinations
environment variable.
Throws an error if a destination with the same name as the given test destination already exists.
Name of the test destination to add to the destinations
environment variable
References to the systems.json
and credentials.json
files
Set a given destination in the destinations
environment variable.
Throws an error if a destination with the same name as the given test destination already exists.
Test destination to add to the destinations
environment variable
Removes all test destinations stored in systems.json
and credentials.json
files or added through [[setTestDestination()]] from the destinations
environment variable.
This function should be called to invert the behavior of [[mockAllTestDestinations()]] and other add single mocked destination functions.
Removes a destination with the given name from the destinations environment variable. If the given destination name is not found calling this function has no effect. This function should be called to invert the behavior of [[mockTestDestination()]] and [[setTestDestination()]].
Name of the mocked destination to remove
cloud-sdk-test-utils
Package that contains utility functions for testing, like loading credentials or creating test destinations.