diff --git a/packages/core/test/injector/module.spec.ts b/packages/core/test/injector/module.spec.ts index b3b27b473ea..ddc736e0855 100644 --- a/packages/core/test/injector/module.spec.ts +++ b/packages/core/test/injector/module.spec.ts @@ -54,7 +54,7 @@ describe('Module', () => { const setSpy = sinon.spy(collection, 'set'); (module as any)._injectables = collection; - module.addInjectable(TestProvider); + module.addInjectable(TestProvider, TestModule); expect( setSpy.calledWith( 'TestProvider', @@ -413,4 +413,25 @@ describe('Module', () => { }); }); }); + + describe('getter "id"', () => { + it('should return module id', () => { + // tslint:disable-next-line:no-string-literal + expect(module.id).to.be.equal(module['_id']); + }); + }); + + describe('getProviderByKey', () => { + describe('when does not exist', () => { + it('should return undefined', () => { + expect(module.getProviderByKey('test')).to.be.undefined; + }); + }); + describe('otherwise', () => { + it('should return instance wrapper', () => { + module.addProvider(TestProvider); + expect(module.getProviderByKey('TestProvider')).to.not.be.undefined; + }); + }); + }); });