# 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:
    - test_suite.js, line 32

### Methods

#### after(callback) → {TestSuite}

  Set a callback executed after the tests.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | function | the callback

  Source:
    - test_suite.js, line 78

  ##### 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:
    - test_suite.js, line 95

  ##### 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:
    - test_suite.js, line 44

  ##### 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:
    - test_suite.js, line 61

  ##### 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 TestCompletion object can be used to get a completion callback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `vertx` | Vertx | the vertx instance
  `options` | Object | the test options

  Source:
    - test_suite.js, line 135

  ##### Returns:

  the related test completion
  Type
    TestCompletion

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

  Add a new test case to the suite.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `name` | string | the test case name
  `testCase` | function | the test case

  Source:
    - test_suite.js, line 113

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    TestSuite