Created
January 21, 2015 15:24
-
-
Save krusynth/f3d1cc9826031ba0e0a0 to your computer and use it in GitHub Desktop.
Example using Squire for Dependency injection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['squire'], function (Squire) { | |
"use strict"; | |
describe("DashboardIndexController", function () { | |
var context = {}; | |
var ready = false; | |
beforeEach(function () { | |
runs(function () { | |
context.injector = new Squire(); | |
context.injector.store( | |
'vent' | |
).require([ | |
'controllers/dashboard/index', 'mocks' | |
], function (DashboardIndexController, mocks) { | |
context.Controller = DashboardIndexController; | |
context.mocks = mocks; | |
ready = true; | |
}); | |
}); | |
waitsFor(function () { | |
return ready; | |
}); | |
}); | |
it("should be defined", function () { | |
expect(context.Controller).toBeDefined(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment