Skip to content

Commit

Permalink
chore: cleanup, add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bigopon committed Aug 10, 2024
1 parent dc4ac23 commit 29804a4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 102 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ npm-debug.log*
.rollupcache
dist/doc-temp
dist/test
doc/typedoc
doc/typedoc
.npmrc
8 changes: 0 additions & 8 deletions .oxlintrc.json

This file was deleted.

57 changes: 0 additions & 57 deletions karma.conf.js

This file was deleted.

21 changes: 19 additions & 2 deletions test/resolve.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,11 @@ describe('resolve()', () => {
});
});

describe('combo', function () {
describe('combo', () => {
it('works with a combination of usages', () => {
class Bar {}
class Foo {
provider: () => Bar = resolve(Lazy.of(Bar));
constructor(...args: any[]) {}
}

const foo1 = container.get(NewInstance.of(Foo));
Expand All @@ -171,5 +170,23 @@ describe('resolve()', () => {
expect(bar1).toBe(bar2);
expect(container.getAll(Bar)).toEqual([bar1]);
});

it('works with nested resolve', () => {
class Bar {}
class Foo {
provider = resolve(Lazy.of(Bar));
}
class Baz {
foo = resolve(NewInstance.of(Foo));
}

const baz1 = container.get(NewInstance.of(Baz));
const baz2 = container.get(NewInstance.of(Baz));

expect(baz1).not.toBe(baz2);
expect(baz1.foo).not.toBe(baz2.foo);
expect(baz1.foo.provider()).toBe(baz2.foo.provider());
expect(container.getAll(Bar)).toEqual([baz1.foo.provider()]);
});
});
});
13 changes: 0 additions & 13 deletions tsconfig.dts.json

This file was deleted.

21 changes: 0 additions & 21 deletions tslint.json

This file was deleted.

0 comments on commit 29804a4

Please sign in to comment.