fix: rm deprecated class modules, clean up, rm indirection (#355)

* refactor: rm deprecations, clean up, rm indirection

* fix: singleton init not being fired when inserting function

* refactor and generic internal add

* deprecate a few things that i impusively added lol
This commit is contained in:
Jacob Nguyen
2024-02-17 11:35:53 -06:00
committed by GitHub
parent 45cbda7b42
commit 48f9f6ec16
17 changed files with 137 additions and 176 deletions

View File

@@ -98,4 +98,16 @@ describe('ioc container', () => {
container.ready();
expect(dependency.init).toHaveBeenCalledTimes(1);
})
it('should detect a key already exists', () => {
container.add({ '@sern/client': dependency2 });
expect(container.hasKey('@sern/client')).toBeTruthy()
})
it('should detect a key already exists', () => {
container.add({ '@sern/client': () => dependency2 });
expect(container.hasKey('@sern/client')).toBeTruthy()
})
});