Last active
January 21, 2016 12:32
-
-
Save derhuerst/8f30d4773ff5ce2776cd to your computer and use it in GitHub Desktop.
minimal test using intravenous
This file contains 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
factory = (a) -> foo: 'bar' | |
module.exports = factory |
This file contains 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
factory = (a) -> baz: a | |
factory.$inject = ['a'] | |
module.exports = factory |
This file contains 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
a = require './a' | |
b = require './b' | |
container = (require 'intravenous').create() | |
container.register 'a', a | |
container.register 'b', b | |
module.exports = container |
This file contains 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
#!/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