@@ -16,8 +16,8 @@ import { routePreProcessor } from '../src/Server/routePreProcessor'
1616
1717test . group ( 'Route pre processor' , ( group ) => {
1818 group . afterEach ( ( ) => {
19- delete global [ ' use']
20- delete global [ ' make']
19+ delete global [ Symbol . for ( 'ioc. use') ]
20+ delete global [ Symbol . for ( 'ioc. make') ]
2121 } )
2222
2323 test ( 'process route by resolving function based middleware' , ( assert ) => {
@@ -63,7 +63,7 @@ test.group('Route pre processor', (group) => {
6363
6464 const ioc = new Ioc ( )
6565 ioc . bind ( 'App/Middleware/Auth' , ( ) => Auth )
66- global [ ' use'] = ioc . use . bind ( ioc )
66+ global [ Symbol . for ( 'ioc. use') ] = ioc . use . bind ( ioc )
6767
6868 middlewareStore . registerNamed ( { auth : 'App/Middleware/Auth' } )
6969
@@ -102,7 +102,7 @@ test.group('Route pre processor', (group) => {
102102
103103 const ioc = new Ioc ( )
104104 ioc . bind ( 'App/Controllers/Http/UserController' , ( ) => UserController )
105- global [ ' use'] = ioc . use . bind ( ioc )
105+ global [ Symbol . for ( 'ioc. use') ] = ioc . use . bind ( ioc )
106106
107107 const route = router . get ( '/' , 'UserController.store' ) . toJSON ( )
108108 routePreProcessor ( route , middlewareStore )
@@ -124,7 +124,7 @@ test.group('Route pre processor', (group) => {
124124
125125 const ioc = new Ioc ( )
126126 ioc . bind ( 'UserController' , ( ) => UserController )
127- global [ ' use'] = ioc . use . bind ( ioc )
127+ global [ Symbol . for ( 'ioc. use') ] = ioc . use . bind ( ioc )
128128
129129 const route = router . get ( '/' , '/UserController.store' ) . toJSON ( )
130130 routePreProcessor ( route , middlewareStore )
@@ -146,12 +146,12 @@ test.group('Route pre processor', (group) => {
146146
147147 const ioc = new Ioc ( )
148148 ioc . bind ( 'UserController' , ( ) => UserController )
149- global [ ' use'] = ioc . use . bind ( ioc )
149+ global [ Symbol . for ( 'ioc. use') ] = ioc . use . bind ( ioc )
150150
151151 const route = router . get ( '/' , '/UserController' ) . toJSON ( )
152152 const fn = ( ) => routePreProcessor ( route , middlewareStore )
153153
154- assert . throw ( fn , 'Missing controller method on `/` route ' )
154+ assert . throw ( fn , 'E_INVALID_IOC_NAMESPACE: Missing method reference on {/UserController} namespace ' )
155155 } )
156156
157157 test ( 'raise error when controller method is missing' , ( _assert ) => {
@@ -163,7 +163,7 @@ test.group('Route pre processor', (group) => {
163163
164164 const ioc = new Ioc ( )
165165 ioc . bind ( 'App/Controllers/Http/UserController' , ( ) => UserController )
166- global [ ' use'] = ioc . use . bind ( ioc )
166+ global [ Symbol . for ( 'ioc. use') ] = ioc . use . bind ( ioc )
167167
168168 const route = router . get ( '/' , '/UserController.store' ) . toJSON ( )
169169 routePreProcessor ( route , middlewareStore )
0 commit comments