@@ -63,70 +63,70 @@ describe('ApplicationContext Specification', () => {
6363 await assert . isRejected ( applicationContext . start ( ) , Error , 'Duplicate definition of application context component (simpleClass)' ) ;
6464 } ) ;
6565
66- it ( 'ApplicationContext accepts Context array' , ( ) => {
66+ it ( 'ApplicationContext accepts Context array' , async ( ) => {
6767 const context = new Context ( [ new Component ( SimpleClass ) ] ) ;
6868
6969 const applicationContext = new ApplicationContext ( [ context ] ) ;
70- applicationContext . start ( ) ;
70+ await applicationContext . start ( ) ;
7171
7272 const simpleClass = applicationContext . get ( 'simpleClass' ) ;
7373 assert . exists ( simpleClass , 'simpleClass exists' ) ;
7474 } ) ;
7575
76- it ( 'ApplicationContext accepts Context object' , ( ) => {
76+ it ( 'ApplicationContext accepts Context object' , async ( ) => {
7777 const context = new Context ( new Component ( SimpleClass ) ) ;
7878
7979 const applicationContext = new ApplicationContext ( context ) ;
80- applicationContext . start ( ) ;
80+ await applicationContext . start ( ) ;
8181
8282 const simpleClass = applicationContext . get ( 'simpleClass' ) ;
8383 assert . exists ( simpleClass , 'simpleClass exists' ) ;
8484 } ) ;
8585
86- it ( 'ApplicationContext accepts Component object' , ( ) => {
86+ it ( 'ApplicationContext accepts Component object' , async ( ) => {
8787 const context = new Component ( SimpleClass ) ;
8888
8989 const applicationContext = new ApplicationContext ( context ) ;
90- applicationContext . start ( ) ;
90+ await applicationContext . start ( ) ;
9191
9292 const simpleClass = applicationContext . get ( 'simpleClass' ) ;
9393 assert . exists ( simpleClass , 'simpleClass exists' ) ;
9494 } ) ;
9595
96- it ( 'ApplicationContext accepts plain old class' , ( ) => {
96+ it ( 'ApplicationContext accepts plain old class' , async ( ) => {
9797 const context = SimpleClass ;
9898
9999 const applicationContext = new ApplicationContext ( context ) ;
100- applicationContext . start ( ) ;
100+ await applicationContext . start ( ) ;
101101
102102 const simpleClass = applicationContext . get ( 'simpleClass' ) ;
103103 assert . exists ( simpleClass , 'simpleClass exists' ) ;
104104 } ) ;
105105
106- it ( 'ApplicationContext accepts plain old object' , ( ) => {
106+ it ( 'ApplicationContext accepts plain old object' , async ( ) => {
107107 const context = { name : 'SimpleClass' , uuid : uuidv4 ( ) } ;
108108
109109 const applicationContext = new ApplicationContext ( context ) ;
110- applicationContext . start ( ) ;
110+ await applicationContext . start ( ) ;
111111
112112 const simpleClass = applicationContext . get ( 'simpleClass' ) ;
113113 assert . exists ( simpleClass , 'simpleClass exists' ) ;
114114 } ) ;
115115
116- // it('ApplicationContext accepts plain old object, with require', () => {
117- // const context = { name: 'SimpleClass',
118- // require: './test/service/SimpleClass',
119- // };
120- //
121- // const applicationContext = new ApplicationContext(context);
122- // applicationContext.start();
123- //
124- // const simpleClass = applicationContext.get('simpleClass');
125- // assert.exists(simpleClass, 'simpleClass exists');
126- // assert.exists(simpleClass.uuid, 'simpleClass.uuid exists');
127- // });
128-
129- it ( 'ApplicationContext accepts config context' , ( ) => {
116+ it ( 'ApplicationContext accepts plain old object, with require' , async ( ) => {
117+ const context = { name : 'SimpleClass' ,
118+ require : './test/service/SimpleClass.js ' ,
119+ } ;
120+
121+ const applicationContext = new ApplicationContext ( context ) ;
122+ await applicationContext . start ( ) ;
123+
124+ const simpleClass = applicationContext . get ( 'simpleClass' ) ;
125+ assert . exists ( simpleClass , 'simpleClass exists' ) ;
126+ assert . exists ( simpleClass . uuid , 'simpleClass.uuid exists' ) ;
127+ } ) ;
128+
129+ it ( 'ApplicationContext accepts config context' , async ( ) => {
130130 const ephemeralConfig = new EphemeralConfig (
131131 {
132132 context : {
@@ -136,7 +136,7 @@ describe('ApplicationContext Specification', () => {
136136 ) ;
137137
138138 const applicationContext = new ApplicationContext ( { config : ephemeralConfig } ) ;
139- applicationContext . start ( ) ;
139+ await applicationContext . start ( ) ;
140140
141141 const simpleClass = applicationContext . get ( 'simpleClass' ) ;
142142 assert . exists ( simpleClass , 'simpleClass exists' ) ;
0 commit comments