Class: TestSuite

vertx-unit-js/test_suite~ TestSuite

new TestSuite()

A named suite of test cases that are executed altogether. The suite suite is created with
Source:

Methods

after(callback) → {TestSuite}

Set a callback executed after the tests.
Parameters:
Name Type Description
callback function the callback
Source:
Returns:
a reference to this, so the API can be used fluently
Type
TestSuite

afterEach(callback) → {TestSuite}

Set a callback executed after each test and before the suite after callback.
Parameters:
Name Type Description
callback function the callback
Source:
Returns:
a reference to this, so the API can be used fluently
Type
TestSuite

before(callback) → {TestSuite}

Set a callback executed before the tests.
Parameters:
Name Type Description
callback function the callback
Source:
Returns:
a reference to this, so the API can be used fluently
Type
TestSuite

beforeEach(callback) → {TestSuite}

Set a callback executed before each test and after the suite before callback.
Parameters:
Name Type Description
callback function the callback
Source:
Returns:
a reference to this, so the API can be used fluently
Type
TestSuite

run(vertx, options) → {TestCompletion}

Run the testsuite with the specified options and the specified vertx instance.

The test suite will be executed on the event loop provided by the vertx argument when TestOptions is not set to false. The returned Completion object can be used to get a completion callback.

Parameters:
Name Type Description
vertx Vertx the vertx instance
options Object the test options
Source:
Returns:
the related test completion
Type
TestCompletion

test(name, repeat, testCase) → {TestSuite}

Add a new test case to the suite.
Parameters:
Name Type Description
name string the test case name
repeat number the number of times the test should be repeated
testCase function the test case
Source:
Returns:
a reference to this, so the API can be used fluently
Type
TestSuite