Skip to content

Commit 5963d18

Browse files
author
Umed Khudoiberdiev
committed
fixed failing test
1 parent 4753b85 commit 5963d18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Container.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ export class Container {
7575

7676
// if named service was requested and its instance was not found plus there is not type to know what to initialize,
7777
// this means service was not pre-registered and we throw an exception
78-
if ((!service || !service.type) && (typeof identifier === "string" || identifier instanceof Token))
78+
if ((!service || !service.type) &&
79+
(!service || !service.factory) &&
80+
(typeof identifier === "string" || identifier instanceof Token))
7981
throw new ServiceNotFoundError(identifier);
8082

8183
// at this point we either have type in service registered, either identifier is a target type

0 commit comments

Comments
 (0)