Life-Cycle Methods
Before and After Specs
describe("A spec (with setup and tear-down)", function() {
beforeEach(function( currentSpec ) {
coldbox = 22;
application.wirebox = new coldbox.system.ioc.Injector();
});
afterEach(function( currentSpec ) {
coldbox = 0;
structDelete( application, "wirebox" );
});
it("is just a function, so it can contain any code", function() {
expect( coldbox ).toBe( 22 );
});
it("can have more than one expectation and talk to scopes", function() {
expect( coldbox ).toBe( 22 );
expect( application.wirebox.getInstance( 'MyService' ) ).toBeComponent();
});
});Around Specs
Annotations
Lifecycle Nesting Order
Last updated
Was this helpful?