BDD
beforeAll()
- Executes once before all specs for the entire test bundle CFCafterAll()
- Executes once after all specs complete in the test bundle CFCrun( testResults, TestBox )
- Executes once so it can capture all your describe and it blocksbeforeEach( body, data )
- Executes before every single spec in a single describe block and receives the currently executing spec.afterEach( body, data )
- Executes after every single spec in a single describe block and receives the currently executing spec.aroundEach( body, data )
- Executes around the executing spec so you can provide code surrouding the spec.
The great flexibility of the BDD approach is that it allows you to nest describe
blocks or create multiple describe
blocks. Each describe
block can have its own life-cycle methods as well. Not only that, if they are nested, TestBox will walk the tree and call each beforeEach()
and afterEach()
in the order you declare them.
Life-Cycle Data Binding
You can pass in an argument called data
which is a struct
of dynamic data to pass into the life-cycle method. You can then pickup this data in the closure for the life-cycle.
Here is a typical example:
Last updated