Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Developer notes for this API... |
Test Modes
Properties of mode objects – optional properties should not be specified if not applicable.
Property | Type | Mandatory | Notes |
---|---|---|---|
name | String | The mode name, in uppercase. Note: Internally there is also a special "TIMEOUT" mode. | |
after | String | Test end event to call at the end of a unit test. Possible values:Either
| |
appendTo | String | If test appends an existing test, this is the name of the test that results will be appended to. Default: Do not append results to another test. | |
expect | Number | Number of results that must be logged before test is allowed to pass Default: Do not prevent test from passing due to number of results Note: Ignored if appendTo property is defined | |
ttl | Number | If after == "WAIT" and the test has not passed or failed, this is the amount of of time (in game milliseconds) the test remains active for until timing out. Default:
|
Test States
Public constants but really aimed at internal use...
State | Value | Notes |
---|---|---|
Test.UNIT_PENDING | undefined | Indicates the test has not yet started |
Test.UNIT_RUNNING | null | Indicates the test is running (or waiting for more results in case of asynch mode) |
Test.UNIT_SUCCESS | true | Indicates test has completed successfully |
Test.UNIT_FAILED | false | Indicates test has failed |
Test End Events
Each unit test ends with one of the following events (either implicitly or due to a signal, etc).
Event | Notes | Effect on test state |
---|---|---|
"ERROR" | An error was thrown while running the test | Test.UNIT_FAILED |
"ABORT" | An ABORT( ) signal was sent while running the test | Test.UNIT_FAILED |
"REQUIRE" | A REQUIRE( ) signal was sent while running the test | Test.UNIT_FAILED |
"DONE" | A synchronous test has finished | Test.UNIT_SUCCESS / Test.UNIT_FAILED |
"FINISH" | A FINISH( ) signal was sent while running the test | Test.UNIT_SUCCESS / Test.UNIT_FAILED |
"TIMEOUT" | An asynchronous test has timed-out | Test.UNIT_SUCCESS / Test.UNIT_FAILED |
"WAIT" | An asynchronous test has finished – check if it's passed, failed or still running | If passed or failed, redirect to "DONE" Otherwise: Test.UNIT_RUNNING |
Div | ||
---|---|---|
| ||
Everything on this page relates to the internal code of the API and is thus liable to change without warning. |
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
RoadmapFuture plans:
|