Versions Compared

Key

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

A simple state checking assertion...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
ok( state, message );

Parameters

ParameterTypeMandatoryNotesAPI Version
stateBoolean(tick)If the state typecasts to true, the test assertion passes, if it typecasts to false, otherwise it fails.1.0
messageString(tick)A message stating what the assertion is testing.1.0

Return Values

ValueTypeNotesAPI Version
<error>ErrorMost likely the parameters are wrong.1.0
trueBooleanThe assertion passed.1.0
falseBooleanThe assertion failed.1.0

Example

Code Block
themeRDark
languagejavascript
linenumberstrue
Test("Is chat() defined?", Test.ANY( ), function(_global, settings) {
	// assertion will fail on WZ 3.1 branch
	ok( _global.hasOwnProperty("chat"), "chat() defined" );
});
Div
classbox
Availability
Status
colourYellow
titleBeta

Requires:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

Test API

Topics:

Child pages (Children Display)
alltrue
depthall
pageTest API
excerpttrue