A simple state checking assertion...

 

Syntax

ok( state, message );

Parameters

ParameterTypeMandatoryNotesAPI Version
stateBoolean(tick)If state typecasts to true, the assertion passes, 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

Test("Is chat() defined?", Test.ANY( ), function() {
	// assertion will fail on WZ 3.1 branch
	ok( _global.hasOwnProperty("chat"), "chat() defined" );
});
Availability

Requires:

Contents

Jump to:

Test API

Topics: