Asynchronous Testing
describe(title="A spec (with setup and tear-down)", asyncAll=true, body=function() {
beforeEach(function() {
coldbox = 22;
application.wirebox = new coldbox.system.ioc.Injector();
});
afterEach(function() {
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();
});
});Last updated
Was this helpful?