Class: ServiceTester

core/service-test-runner/service-tester~ServiceTester(attrs)

Encapsulate a suite of tests. Create new tests using create() and register them with Mocha using toss().

Constructor

new ServiceTester(attrs)

Service Tester Constructor

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Description
id string

Specifies which tests to run from the CLI or pull requests

title string

Prints in the Mocha output

pathPrefix string

Prefix which is automatically prepended to each tested URI. The default is /${attrs.id}.

Source:
See:

Methods

beforeEach()

Invoked before each test. This is a stub which can be overridden on instances.

Source:

create(msg) → {module:icedfrisby~IcedFrisby}

Create a new test. The hard work is delegated to IcedFrisby. https://github.com/MarkHerhold/IcedFrisby/#show-me-some-code

Note: The caller should not invoke toss() on the Frisby chain, as it's invoked automatically by the tester.

Parameters:
Name Type Description
msg string

The name of the test

Source:
Returns:

IcedFrisby instance

Type
module:icedfrisby~IcedFrisby

only()

Run only this tester. This can be invoked using the --only argument to the CLI, or directly on the tester.

Source:

toss(attrs)

Register the tests with Mocha.

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Description
baseUrl string

base URL for test server

skipIntercepted boolean

skip tests which intercept requests

retry object

retry configuration

Properties
Name Type Description
count number

number of times to retry test

backoff number

number of milliseconds to add to the wait between each retry

Source:

(static) forServiceClass(ServiceClass) → {module:core/service-test-runner/service-tester~ServiceTester}

Construct a ServiceTester instance for a single service class

Parameters:
Name Type Description
ServiceClass function

A class that extends base-service/base.BaseService

Source:
Returns:

ServiceTester for ServiceClass

Type
module:core/service-test-runner/service-tester~ServiceTester