Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment:
Migrated to Confluence 5.3
Excerpt |
---|
A simple state checking assertion... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
ok( state, message ); |
Parameters
||Parameter |
---|
Type |
---|
Mandatory | Notes | API Version | ||
---|---|---|---|---|
state | Boolean | If state typecasts to true , the assertion passes, otherwise it fails. | 1.0 | |
message | String | A message stating what the assertion is testing. | 1.0 |
Return Values
Value | Type | Notes | API Version |
---|---|---|---|
<error> | Error | Most likely the parameters are wrong. | 1.0 |
true | Boolean | The assertion passed. | 1.0 |
false | Boolean | The assertion failed. | 1.0 |
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Test("Is chat() defined?", Test.ANY( ), function() {
// assertion will fail on WZ 3.1 branch
ok( _global.hasOwnProperty("chat"), "chat() defined" );
}); |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Test APITopics:
|