refactor(injector): implement support for nested bindings
This commit is contained in:
@ -133,6 +133,15 @@ export function main() {
|
||||
expect(car.engine).toBeAnInstanceOf(Engine);
|
||||
});
|
||||
|
||||
it("should flatten passed-in bindings", function () {
|
||||
var injector = new Injector([
|
||||
[[Engine, Car]]
|
||||
]);
|
||||
|
||||
var car = injector.get(Car);
|
||||
expect(car).toBeAnInstanceOf(Car);
|
||||
});
|
||||
|
||||
it('should use non-type tokens', function () {
|
||||
var injector = new Injector([
|
||||
bind('token').toValue('value')
|
||||
|
Reference in New Issue
Block a user