@@ -60,7 +60,7 @@ describe('scopes', () => {
6060
6161 it ( 'should consider other scopes' , ( ) =>
6262
63- ( ShoeWithScopes . scope ( 'full' ) as typeof ShoeWithScopes ) . findOne ( )
63+ ShoeWithScopes . scope ( 'full' ) . findOne ( )
6464 . then ( shoe => {
6565
6666 expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . is . not . null ;
@@ -79,8 +79,8 @@ describe('scopes', () => {
7979 ) ;
8080
8181 it ( 'should not consider default scope due to unscoped call' , ( ) =>
82- ( ShoeWithScopes
83- . unscoped ( ) as typeof ShoeWithScopes )
82+ ShoeWithScopes
83+ . unscoped ( )
8484 . findOne ( )
8585 . then ( shoe => {
8686 expect ( shoe ) . to . have . property ( 'secretKey' ) . which . is . a ( 'string' ) ;
@@ -91,37 +91,37 @@ describe('scopes', () => {
9191
9292 it ( 'should consider scopes and additional included model (object)' , ( ) =>
9393 expect (
94- ( ShoeWithScopes . scope ( 'full' ) as typeof ShoeWithScopes )
95- . findOne ( {
96- include : [ {
97- model : Person ,
98- } ]
99- } )
100- . then ( shoe => {
101- expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . is . not . null ;
102- expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . have . property ( 'brand' , BRAND ) ;
103- expect ( shoe ) . to . have . property ( 'owner' ) . which . is . not . null ;
104- } )
94+ ShoeWithScopes . scope ( 'full' )
95+ . findOne ( {
96+ include : [ {
97+ model : Person ,
98+ } ]
99+ } )
100+ . then ( shoe => {
101+ expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . is . not . null ;
102+ expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . have . property ( 'brand' , BRAND ) ;
103+ expect ( shoe ) . to . have . property ( 'owner' ) . which . is . not . null ;
104+ } )
105105 ) . not . to . be . rejected
106106 ) ;
107107
108108 it ( 'should consider scopes and additional included model (model)' , ( ) =>
109109 expect (
110- ( ShoeWithScopes . scope ( 'full' ) as typeof ShoeWithScopes )
111- . findOne ( {
112- include : [ Person ]
113- } )
114- . then ( shoe => {
115- expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . is . not . null ;
116- expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . have . property ( 'brand' , BRAND ) ;
117- expect ( shoe ) . to . have . property ( 'owner' ) . which . is . not . null ;
118- } )
110+ ShoeWithScopes . scope ( 'full' )
111+ . findOne ( {
112+ include : [ Person ]
113+ } )
114+ . then ( shoe => {
115+ expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . is . not . null ;
116+ expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . have . property ( 'brand' , BRAND ) ;
117+ expect ( shoe ) . to . have . property ( 'owner' ) . which . is . not . null ;
118+ } )
119119 ) . not . to . be . rejected
120120 ) ;
121121
122122 it ( 'should not consider default scope due to unscoped call, but additonal includes (object)' , ( ) =>
123123
124- ( ShoeWithScopes . unscoped ( ) as typeof ShoeWithScopes )
124+ ShoeWithScopes . unscoped ( )
125125 . findOne ( {
126126 include : [ { model : Person } ]
127127 } )
@@ -133,8 +133,8 @@ describe('scopes', () => {
133133
134134 it ( 'should not consider default scope due to unscoped call, but additonal includes (model)' , ( ) =>
135135
136- ( ShoeWithScopes
137- . unscoped ( ) as typeof ShoeWithScopes )
136+ ShoeWithScopes
137+ . unscoped ( )
138138 . findOne ( {
139139 include : [ Person ]
140140 } )
@@ -159,7 +159,7 @@ describe('scopes', () => {
159159 ) ;
160160
161161 it ( 'should consider scope of included model (with own scope)' , ( ) =>
162- ( ShoeWithScopes . scope ( 'red' ) as typeof ShoeWithScopes )
162+ ShoeWithScopes . scope ( 'red' )
163163 . findOne ( {
164164 include : [ Manufacturer . scope ( 'brandOnly' ) as typeof Manufacturer ]
165165 } )
@@ -177,7 +177,7 @@ describe('scopes', () => {
177177 describe ( 'with nested scope' , ( ) => {
178178
179179 it ( 'should consider nested scope' , ( ) =>
180- ( ShoeWithScopes . scope ( 'manufacturerWithScope' ) as typeof ShoeWithScopes )
180+ ShoeWithScopes . scope ( 'manufacturerWithScope' )
181181 . findOne ( )
182182 . then ( shoe => {
183183 expect ( shoe ) . to . have . property ( 'manufacturer' )
@@ -187,7 +187,7 @@ describe('scopes', () => {
187187 ) ;
188188
189189 it ( 'should not consider nested scope' , ( ) =>
190- ( ShoeWithScopes . scope ( 'full' ) as typeof ShoeWithScopes )
190+ ShoeWithScopes . scope ( 'full' )
191191 . findOne ( )
192192 . then ( shoe => {
193193 expect ( shoe ) . to . have . property ( 'manufacturer' )
@@ -201,15 +201,15 @@ describe('scopes', () => {
201201 describe ( 'with scope function' , ( ) => {
202202
203203 it ( 'should find appropriate shoe due to correctly passed scope function param' , ( ) =>
204- ( ShoeWithScopes . scope ( { method : [ 'primaryColor' , 'red' ] } ) as typeof ShoeWithScopes )
204+ ShoeWithScopes . scope ( { method : [ 'primaryColor' , 'red' ] } )
205205 . findOne ( )
206206 . then ( shoe => {
207207 expect ( shoe ) . to . have . property ( 'primaryColor' , 'red' ) ;
208208 } )
209209 ) ;
210210
211211 it ( 'should find appropriate shoe due to correctly passed scope function param including associated model' , ( ) =>
212- ( ShoeWithScopes . scope ( { method : [ 'primaryColorWithManufacturer' , 'red' ] } ) as typeof ShoeWithScopes )
212+ ShoeWithScopes . scope ( { method : [ 'primaryColorWithManufacturer' , 'red' ] } )
213213 . findOne ( )
214214 . then ( shoe => {
215215 expect ( shoe ) . to . have . property ( 'primaryColor' , 'red' ) ;
0 commit comments