File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ final class ModulesContainer {
259259 final dynamicEntry = await entrypoint.registerAsync (config);
260260 currentScope.extendWithDynamicModule (dynamicEntry);
261261
262- if (currentScope.isEmpty) {
262+ if (currentScope.isEmpty && ! internal && entrypointToken != token ) {
263263 _emptyModules.add (entrypoint.runtimeType);
264264 return ;
265265 }
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ void main() async {
3737
3838 await container.finalize (module);
3939
40- expect (container.scopes.length, 2 );
40+ expect (container.scopes.length, 1 );
4141 },
4242 );
4343
@@ -113,7 +113,11 @@ void main() async {
113113 () async {
114114 final container = ModulesContainer (config);
115115
116- final module = TestModule ();
116+ final module = TestModule (
117+ providers: [
118+ Provider .forValue <String >('TestModuleValue' ),
119+ ]
120+ );
117121 final parents = container.getParents (module);
118122
119123 expect (parents, []);
@@ -125,7 +129,11 @@ void main() async {
125129 ''' ,
126130 () async {
127131 final container = ModulesContainer (config);
128- final subModule = TestSubModule ();
132+ final subModule = TestSubModule (
133+ providers: [
134+ Provider .forValue <String >('TestSubModuleValue' ),
135+ ]
136+ );
129137 final module = TestModule (imports: [subModule]);
130138
131139 await container.registerModules (module);
Original file line number Diff line number Diff line change @@ -92,14 +92,18 @@ void main() {
9292 poweredByHeader: 'Powered by Serinus' ,
9393 ),
9494 );
95- final module = TestModule ();
95+ final module = TestModule (
96+ providers: [
97+ TestProvider ()
98+ ]
99+ );
96100 final container = SerinusContainer (config, _MockAdapter ());
97101 final inspector = container.inspector;
98102 final graph = inspector.graph;
99103 await container.modulesContainer.registerModules (module);
100104 inspector.inspectModules ();
101105 expect (graph, isNotNull);
102- expect (graph.nodes.length, 1 );
106+ expect (graph.nodes.length, 2 );
103107 expect (graph.edges.length, 0 );
104108 },
105109 );
You can’t perform that action at this time.
0 commit comments