Dalek.Test Class
Generates an test instance
Item Index
Methods
Methods
_emitAssertionStatus
()
private
chainable
Emits an event that describes the current state of all assertions
_emitConcreteTestFinished
()
private
chainable
Emits an event, that the current test run has been finished
_emitTestFinished
()
private
chainable
Emits an event that describes the current state of all assertions. The event should be fired when a test is finished
_inheritAssertions
-
test
-
opts
Set up the instance
Parameters:
-
test
TestInstacne of test
-
opts
ObjectOptions
_inheritAssertions
-
test
Copies assertion helper methods
Parameters:
-
test
TestInstacne of test
_inheritAssertions
-
test
Copies assertion methods
Parameters:
-
test
TestInstacne of test
_onDriverMessage
-
data
Checks if the test run is complete & emits/resolves all the needed events/promises when the run is complete
Parameters:
-
data
ObjectData that is returned by the driver:message event
_reportTestStarted
-
name
Emits the test started event
Parameters:
-
name
StringName of the test
_testFin
()
Object
private
Kicks off the test & binds all promises/events
Returns:
promise A promise
_testFinished
-
result
Emits the test finished events & resolves all promises when its done
Parameters:
-
result
ObjectPromised result var
Returns:
result Promised result var
_testStatus
()
Bool
private
chainable
Get the overall test status (assertions & expectation)
Returns:
status The test status
checkAssertions
()
Bool
Checks if all runned assertions passed
Returns:
assertiosnFailed Any expectation failed
checkExpectations
()
Bool
Checks if the runned tests fullfill the set expectations or if no expectations were raised
Returns:
checkedExpectations Expectations match
done
()
Object
private
Sets up all the bindings needed for a test to run
Returns:
result A promise
expect
-
key
-
value
Global data store (works between the node & browser envs)
Parameters:
-
key
String | NumberKey to store or fetch data
-
value
Mixedoptional Data that should be stored
Returns:
Data that has been stored
expect
-
expecatation
Specify how many assertions are expected to run within a test. Very useful for ensuring that all your callbacks and assertions are run.
Parameters:
-
expecatation
IntegerNumber of assertions that should be run
incrementExpectations
()
chainable
Increment the number of executed assertions
incrementFailedAssertions
()
chainable
Increment the number of failed assertions