@@ -60,7 +60,7 @@ describe('scopes', () => {
60
60
61
61
it ( 'should consider other scopes' , ( ) =>
62
62
63
- ( ShoeWithScopes . scope ( 'full' ) as typeof ShoeWithScopes ) . findOne ( )
63
+ ShoeWithScopes . scope ( 'full' ) . findOne ( )
64
64
. then ( shoe => {
65
65
66
66
expect ( shoe ) . to . have . property ( 'manufacturer' ) . which . is . not . null ;
@@ -79,8 +79,8 @@ describe('scopes', () => {
79
79
) ;
80
80
81
81
it ( 'should not consider default scope due to unscoped call' , ( ) =>
82
- ( ShoeWithScopes
83
- . unscoped ( ) as typeof ShoeWithScopes )
82
+ ShoeWithScopes
83
+ . unscoped ( )
84
84
. findOne ( )
85
85
. then ( shoe => {
86
86
expect ( shoe ) . to . have . property ( 'secretKey' ) . which . is . a ( 'string' ) ;
@@ -91,37 +91,37 @@ describe('scopes', () => {
91
91
92
92
it ( 'should consider scopes and additional included model (object)' , ( ) =>
93
93
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
+ } )
105
105
) . not . to . be . rejected
106
106
) ;
107
107
108
108
it ( 'should consider scopes and additional included model (model)' , ( ) =>
109
109
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
+ } )
119
119
) . not . to . be . rejected
120
120
) ;
121
121
122
122
it ( 'should not consider default scope due to unscoped call, but additonal includes (object)' , ( ) =>
123
123
124
- ( ShoeWithScopes . unscoped ( ) as typeof ShoeWithScopes )
124
+ ShoeWithScopes . unscoped ( )
125
125
. findOne ( {
126
126
include : [ { model : Person } ]
127
127
} )
@@ -133,8 +133,8 @@ describe('scopes', () => {
133
133
134
134
it ( 'should not consider default scope due to unscoped call, but additonal includes (model)' , ( ) =>
135
135
136
- ( ShoeWithScopes
137
- . unscoped ( ) as typeof ShoeWithScopes )
136
+ ShoeWithScopes
137
+ . unscoped ( )
138
138
. findOne ( {
139
139
include : [ Person ]
140
140
} )
@@ -159,7 +159,7 @@ describe('scopes', () => {
159
159
) ;
160
160
161
161
it ( 'should consider scope of included model (with own scope)' , ( ) =>
162
- ( ShoeWithScopes . scope ( 'red' ) as typeof ShoeWithScopes )
162
+ ShoeWithScopes . scope ( 'red' )
163
163
. findOne ( {
164
164
include : [ Manufacturer . scope ( 'brandOnly' ) as typeof Manufacturer ]
165
165
} )
@@ -177,7 +177,7 @@ describe('scopes', () => {
177
177
describe ( 'with nested scope' , ( ) => {
178
178
179
179
it ( 'should consider nested scope' , ( ) =>
180
- ( ShoeWithScopes . scope ( 'manufacturerWithScope' ) as typeof ShoeWithScopes )
180
+ ShoeWithScopes . scope ( 'manufacturerWithScope' )
181
181
. findOne ( )
182
182
. then ( shoe => {
183
183
expect ( shoe ) . to . have . property ( 'manufacturer' )
@@ -187,7 +187,7 @@ describe('scopes', () => {
187
187
) ;
188
188
189
189
it ( 'should not consider nested scope' , ( ) =>
190
- ( ShoeWithScopes . scope ( 'full' ) as typeof ShoeWithScopes )
190
+ ShoeWithScopes . scope ( 'full' )
191
191
. findOne ( )
192
192
. then ( shoe => {
193
193
expect ( shoe ) . to . have . property ( 'manufacturer' )
@@ -201,15 +201,15 @@ describe('scopes', () => {
201
201
describe ( 'with scope function' , ( ) => {
202
202
203
203
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' ] } )
205
205
. findOne ( )
206
206
. then ( shoe => {
207
207
expect ( shoe ) . to . have . property ( 'primaryColor' , 'red' ) ;
208
208
} )
209
209
) ;
210
210
211
211
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' ] } )
213
213
. findOne ( )
214
214
. then ( shoe => {
215
215
expect ( shoe ) . to . have . property ( 'primaryColor' , 'red' ) ;
0 commit comments