Options
All
  • Public
  • Public/Protected
  • All
Menu

Stellar Anchor Tests

Index

Type aliases

SEP

SEP: 1 | 6 | 10 | 12 | 24 | 31 | 38

The Stellar Ecosystem Proposals (SEPs) this library supports testing.

Functions

getTests

  • Gets all tests that run would run for a given Config passed.

    This is helpful if you want to use test objects prior to running. For example, the tests returned could be displayed in a UI prior to running the tests.

    The function will raise an exception if a cycle is detected. A cycle is when a test depends, directly or indirectly, on itself.

    throws

    ConfigError if the config is invalid in some way.

    Parameters

    • config: Config

      the Config object to used to determine which tests to return.

    Returns Promise<Test[]>

run

  • Gets tests based on the SEPs and search strings specified in config and calls runTests, which ensures all depedencies are run prior to each test. Each test run is yield'ed back to the caller.

    The function will raise an exception if a cycle is detected. A cycle is when a test depends, directly or indirectly, on itself.

    throws

    ConfigError if the config is invalid in some way.

    Parameters

    Returns AsyncGenerator<TestRun>

runTests

  • Runs the tests passed, including dependencies, and yields them back to the caller.

    Maintains a global context object. Expects each test to provide the data defined in Context.provides to the global context and ensures the global context has the data defined in each Context.expects.

    If a test directly or indirectly depends on itself or if one of its dependencies fails, a relevant [[Faliure]] will be added to the test's result and yielded and the test will not be run.

    throws

    ConfigError if the config is invalid in some way.

    Parameters

    Returns AsyncGenerator<TestRun>