# Class: TestCompletion

## vertx-unit-js/test_completion~ TestCompletion

#### new TestCompletion()

  This object provides callback-ability for the end of a test suite.
  Source:
    - test_completion.js, line 30

### Methods

#### await(timeoutMillis)

  Cause the current thread to wait until the test suite completes with a configurable timeout.

  If completion times out or the current thread is interrupted, an exception will be thrown.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `timeoutMillis` | number | the timeout in milliseconds

  Source:
    - test_completion.js, line 118

#### awaitSuccess(timeoutMillis)

  Cause the current thread to wait until the test suite completes and succeeds with a configurable timeout.

  If completion times out or the current thread is interrupted or the suite fails, an exception will be thrown.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `timeoutMillis` | number | the timeout in milliseconds

  Source:
    - test_completion.js, line 135

#### handler(completionHandler)

  Completion handler for the end of the test, the result is successful when all test cases pass otherwise it is failed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `completionHandler` | function | the completion handler

  Source:
    - test_completion.js, line 97

#### isCompleted() → {boolean}

  Source:
    - test_completion.js, line 55

  ##### Returns:

  - true if the test suite completed
  - Type
      boolean

#### isFailed() → {boolean}

  Source:
    - test_completion.js, line 83

  ##### Returns:

  - true if the test suite completed and failed
  - Type
      boolean

#### isSucceeded() → {boolean}

  Source:
    - test_completion.js, line 69

  ##### Returns:

  - true if the test suite completed and succeeded
  - Type
      boolean

#### resolve(future)

  Completes the future when all test cases of the test suite passes, otherwise fails it.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `future` | Future | the future to resolve

  Source:
    - test_completion.js, line 41