Class: Tester

'brixy.tester.Tester'~ Tester

new Tester ()

Tester object. Default behavior is defined by the setConfig() and getConfig() methods.

Predefined values Default Description
dialogOnFailure true Shows the report dialog when test fails.
comparisonDepth 10 Default nesting level of the comparison of the objects. Used by the job assert methods.
assertLibrary 'brixy.tester.It' Default assert library is specified by the constructor or module name.
Source:

Methods

addJob (nameopt) → {module:'brixy.tester.Job'~Job}

Creates new job.

Parameters:
Name Type Attributes Description
name string <optional>

Job name.

Returns:
Source:

clearJobs ()

Removes all jobs.

Source:

errorReport (e)

Shows a dialog with error report.

Parameters:
Name Type Description
e *

Error object or message.

Source:

getConfig (name) → {*}

Gets the config value.

Parameters:
Name Type Description
name string

Name of the option.

Returns:
  • * :

    Config value or undefined.

Source:

report ()

Shows a dialog with tester result.

Source:

runJobFiles (folder, fileFilteropt, folderFilteropt)

Runs all test files in the folder. Default allowed file names: *job.(jsx|jsxinc|js).

Parameters:
Name Type Attributes Description
folder string | Folder

Full path to a job file or folder with job files.

fileFilter function <optional>

Callback filters the files in the job folders: function(path){return boolean;}. By default, accepts all files whose name ends with job.jsx / job.jsxinc / job.js. (optional)

folderFilter function <optional>

Callback filters the job folders: function(path){return boolean;}. By default, accepts all folders and subfolders. (optional)

Throws:
  • Exception on error.

Source:

setConfig (nameOrObject, valueopt)

Changes default config options or adds custom values.
All options are available in job files via tester.getConfig('something').

Parameters:
Name Type Attributes Description
nameOrObject string | object

Name of the config option. If object is given, all key/value pairs are set to config and value parameter is ignored.

value * <optional>

Value of the config option. (optional)

Throws:
  • Exception

Source:

toString () → {string}

Returns a string representation of the object.

Returns:
  • string
Source: