Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @sap/cloud-sdk-test-util

cloud-sdk-test-utils

Package that contains utility functions for testing, like loading credentials or creating test destinations.

Index

Functions

getTestDestinationByAlias

  • 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.

    Parameters

    • alias: string

      The alias identifying the destination.

    • Optional options: GetTestDestinationOptions

      Options to control where to start and to stop looking.

    Returns Destination

    An array of destinations.

getTestDestinations

  • Loads all destinations stored in systems.json and credentials.json.

    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.

    Parameters

    Returns Destination[]

    An array of destinations.