Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Events defined by Test API...

 

Overview

Warning

This feature is still under development...

The Test API provides the following events:

EventNotesAPI Version
Test.onStart()Triggered before the first test starts.1.2
Test.onFinish(...)

Triggered after all tests have finished, useful for triggering output of Test Results.

The event has the following parameters:

  • numModules – the total number of Test Modules processed
  • numTests – the total number of Unit Tests processed
  • numPassed – the total number of unit tests that successfully passed
  • numFailed – the total number of unit tests that successfully failed

Note: Tests of mode Test.APPEND( ) are not counted.

1.2

Note: You can use Module Lifecycle Objects if you want to be notified before and after individual tests run.

Examples

Code Block
themeRDark
languagejavascript
titleBrief summary via console
linenumberstrue
Test.onFinish(numModules, numTests, numPassed, numFailed) {
	var msg = "In "+numModules+" modules "
              + "there were "+numTests+" "
              + "of which "+numPassed+" passed "
              + "and "+numFailed+" failed."
	console(msg);
}
Code Block
themeRDark
languagejavascript
titleDetailed results via console
linenumberstrue
Test.onFinish() {
	Test.outputTo("console");
}
Div
classbox
Availability
Status
colour
Red
Green
title
Dev
Stable

Requires:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

Test API

Topics:

Child pages (Children Display)
alltrue
depthall
pageTest API
excerpttrue