Skip to content

Instantly share code, notes, and snippets.

@mmthomas
mmthomas / ServiceKernel.Tests.js
Created December 12, 2012 18:56
QUnit unit tests for ServiceKernel.js (https://gist.github.com/4089076)
// unit tests for ServiceKernel.js (https://gist.github.com/4089076)
// requires QUnit test framework
module("ServiceKernelTests");
if (typeof throws === "undefined") throws = raises;
test("require unregistered service throws", function () {
var kernel = new ServiceKernel();
@mmthomas
mmthomas / ServiceKernel.js
Created November 16, 2012 17:12
A simple JavaScript dependency injection container
/*
*
* A simple JavaScript dependency injection container
* By Monroe Thomas http://blog.coolmuse.com
*
* http://blog.coolmuse.com/2012/11/11/a-simple-javascript-dependency-injection-container/
*
* MIT Licensed.
*
* Unit tests can be found at https://gist.github.com/4270523