Bromine.Test Class
A Test Instance
Constructor
Bromine.Test
-
options
Parameters:
-
options
Object-
[init]
Function optionala function to execute before test start
-
[destroy]
Function optionala function to execute after the test ends (should be used for cleanup)
-
[tests]
Array optionala queue of functions to run
-
[depend]
String optionala test dependancy
-
[fail_timeout=10s]
Integer optionalhow much time to wait for tests to finish before reporting failure
-
Item Index
Methods
Methods
next
()
calls the next function in the stack
-
message
signifies a test failure. Will stop any more steps from running
Parameters:
-
message
String
next
()
calls the next function in the stack
current
()
calls the current function in the stack
prev
()
calls the previous function in the stack
done
-
state
-
[message]
Called when tests are done
Parameters:
-
state
Boolwhether test passed or failed
-
[message]
String optionalonly used on failure
done
-
state
-
[message]
Called when tests are done
Parameters:
-
state
Boolwhether test passed or failed
-
[message]
String optionalonly used on failure
current
()
calls the current function in the stack
prev
()
calls the previous function in the stack
addEvent
-
the
-
a
Adds an event
addEvents
-
literal
Helper to add multiple events at once
Parameters:
-
literal
Objectobject of event types => callbacks
fireEvent
-
event
-
arguments
dispatches an event
Parameters:
-
event
Stringtype
-
arguments
Mixedto pass with the event
removeEvent
-
event
-
function
removes a function from an event
addEventOnce
-
the
-
a
Adds an event for one execution, then removes it
fireLatchedEvent
-
the
-
arguments
Fires a latched event
Parameters:
-
the
Stringevent type
-
arguments
Mixedto pass with the event
-
message
signifies a test failure. Will stop any more steps from running
Parameters:
-
message
String
run
()
runs the tests
run
()
runs the tests
Properties
Events
destory
fires on object destruction
destory
fires on object destruction
done
fires if and when the test has finished running successfuly
done
fires if and when the test has finished running successfuly
fail
fires if and when the test has finished running but failed
fail
fires if and when the test has finished running but failed
start
fires when test starts running. Latched
start
fires when test starts running. Latched