11import  Service ,  {  inject ,  service  }  from  '@ember/service' ; 
22import  EmberObject  from  '@ember/object' ; 
33import  {  buildOwner ,  runDestroy  }  from  'internal-test-helpers' ; 
4- import  {  moduleFor ,  AbstractTestCase  }  from  'internal-test-helpers' ; 
4+ import  {  moduleFor ,  AbstractTestCase ,  testUnless  }  from  'internal-test-helpers' ; 
5+ import  {  DEPRECATIONS  }  from  '../../-internals/deprecations' ; 
56
67moduleFor ( 
78  'inject - decorator (TS)' , 
89  class  extends  AbstractTestCase  { 
9-     [ '@test works with native decorators' ] ( assert : QUnit [ 'assert' ] )  { 
10+     [ `${ testUnless (  
11+       DEPRECATIONS . DEPRECATE_IMPORT_INJECT . isRemoved  
12+     ) }   @test works with native decorators`] ( assert : QUnit [ 'assert' ] )  { 
13+       expectDeprecation ( 
14+         / ' I m p o r t i n g   ` i n j e c t `   f r o m   ` @ e m b e r \/ s e r v i c e `   i s   d e p r e c a t e d .  P l e a s e   i m p o r t   ` s e r v i c e `   i n s t e a d .' / , 
15+         DEPRECATIONS . DEPRECATE_IMPORT_INJECT . isEnabled 
16+       ) ; 
17+ 
1018      let  owner  =  buildOwner ( ) ; 
1119
1220      class  MainService  extends  Service  { } 
@@ -25,7 +33,14 @@ moduleFor(
2533      runDestroy ( owner ) ; 
2634    } 
2735
28-     [ '@test uses the decorated property key if not provided' ] ( assert : QUnit [ 'assert' ] )  { 
36+     [ `${ testUnless (  
37+       DEPRECATIONS . DEPRECATE_IMPORT_INJECT . isRemoved  
38+     ) }   @test uses the decorated property key if not provided`] ( assert : QUnit [ 'assert' ] )  { 
39+       expectDeprecation ( 
40+         / ' I m p o r t i n g   ` i n j e c t `   f r o m   ` @ e m b e r \/ s e r v i c e `   i s   d e p r e c a t e d .  P l e a s e   i m p o r t   ` s e r v i c e `   i n s t e a d .' / , 
41+         DEPRECATIONS . DEPRECATE_IMPORT_INJECT . isEnabled 
42+       ) ; 
43+ 
2944      let  owner  =  buildOwner ( ) ; 
3045
3146      class  MainService  extends  Service  { } 
0 commit comments