Skip to content

Instantly share code, notes, and snippets.

@derhuerst
Last active January 21, 2016 12:32
Show Gist options
  • Save derhuerst/8f30d4773ff5ce2776cd to your computer and use it in GitHub Desktop.
Save derhuerst/8f30d4773ff5ce2776cd to your computer and use it in GitHub Desktop.
minimal test using intravenous
factory = (a) -> foo: 'bar'
module.exports = factory
factory = (a) -> baz: a
factory.$inject = ['a']
module.exports = factory
a = require './a'
b = require './b'
container = (require 'intravenous').create()
container.register 'a', a
container.register 'b', b
module.exports = container
#!/usr/bin/env coffee
assert = require 'assert'
container = require('./container').create()
mockedA = {}
container.register 'a', mockedA
b = container.get 'b'
assert.deepEqual b, baz: mockedA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment