OpenVeo test API

API Docs for: 8.0.0
Show:

util

Defined in: lib/util.js:3
Module: util

Summary

Exposes a list of functions to help writing tests.

Item Index

Methods

Methods

check

Defined in lib/util.js:12

Syntax

check

(
  • testFunction
  • done
  • {Boolean]
)
static

Summary

Executes a function then call done function.

Exception thrown by the function are catched and transmitted to the done function.

Chai throws exceptions while an assertion fails which makes difficult writing ansynchronous tests. Assertions in asynchronous tests must be surrounding by try/catch and call the Mocha done callback with the error in case of a failing assertion.

Parameters:

  • testFunction Function

    The function to execute

  • done Function

    The function to call after executing the testFunction function

  • {Boolean] Object

    [doNotTerminate=false] Indicates if done function must not be called after executing the testFunction function