Skip to content

Instantly share code, notes, and snippets.

@krusynth
Created January 21, 2015 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krusynth/f3d1cc9826031ba0e0a0 to your computer and use it in GitHub Desktop.
Save krusynth/f3d1cc9826031ba0e0a0 to your computer and use it in GitHub Desktop.
Example using Squire for Dependency injection.
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