@@ -101,6 +101,7 @@ module.exports = (chai, utils) => {
101
101
) ;
102
102
103
103
module . exports . transferPromiseness ( this , derivedPromise ) ;
104
+ return this ;
104
105
} ) ;
105
106
106
107
property ( "rejected" , function ( ) {
@@ -123,6 +124,7 @@ module.exports = (chai, utils) => {
123
124
) ;
124
125
125
126
module . exports . transferPromiseness ( this , derivedPromise ) ;
127
+ return this ;
126
128
} ) ;
127
129
128
130
method ( "rejectedWith" , function ( errorLike , errMsgMatcher , message ) {
@@ -134,9 +136,8 @@ module.exports = (chai, utils) => {
134
136
if ( errorLike === undefined && errMsgMatcher === undefined &&
135
137
message === undefined ) {
136
138
/* eslint-disable no-unused-expressions */
137
- this . rejected ;
139
+ return this . rejected ;
138
140
/* eslint-enable no-unused-expressions */
139
- return ;
140
141
}
141
142
142
143
if ( message !== undefined ) {
@@ -220,14 +221,17 @@ module.exports = (chai, utils) => {
220
221
) ;
221
222
222
223
module . exports . transferPromiseness ( this , derivedPromise ) ;
224
+ return this ;
223
225
} ) ;
224
226
225
227
property ( "eventually" , function ( ) {
226
228
utils . flag ( this , "eventually" , true ) ;
229
+ return this ;
227
230
} ) ;
228
231
229
232
method ( "notify" , function ( done ) {
230
233
doNotify ( getBasePromise ( this ) , done ) ;
234
+ return this ;
231
235
} ) ;
232
236
233
237
method ( "become" , function ( value , message ) {
@@ -243,7 +247,7 @@ module.exports = (chai, utils) => {
243
247
244
248
methodNames . forEach ( methodName => {
245
249
Assertion . overwriteMethod ( methodName , originalMethod => function ( ) {
246
- doAsserterAsyncAndAddThen ( originalMethod , this , arguments ) ;
250
+ return doAsserterAsyncAndAddThen ( originalMethod , this , arguments ) ;
247
251
} ) ;
248
252
} ) ;
249
253
@@ -260,15 +264,15 @@ module.exports = (chai, utils) => {
260
264
Assertion . overwriteChainableMethod (
261
265
getterName ,
262
266
originalMethod => function ( ) {
263
- doAsserterAsyncAndAddThen ( originalMethod , this , arguments ) ;
267
+ return doAsserterAsyncAndAddThen ( originalMethod , this , arguments ) ;
264
268
} ,
265
269
originalGetter => function ( ) {
266
- doAsserterAsyncAndAddThen ( originalGetter , this ) ;
270
+ return doAsserterAsyncAndAddThen ( originalGetter , this ) ;
267
271
}
268
272
) ;
269
273
} else {
270
274
Assertion . overwriteProperty ( getterName , originalGetter => function ( ) {
271
- doAsserterAsyncAndAddThen ( originalGetter , this ) ;
275
+ return doAsserterAsyncAndAddThen ( originalGetter , this ) ;
272
276
} ) ;
273
277
}
274
278
} ) ;
@@ -278,7 +282,7 @@ module.exports = (chai, utils) => {
278
282
// `eventually`, or if we've already fulfilled the promise (see below).
279
283
if ( ! utils . flag ( assertion , "eventually" ) ) {
280
284
asserter . apply ( assertion , args ) ;
281
- return ;
285
+ return assertion ;
282
286
}
283
287
284
288
const derivedPromise = getBasePromise ( assertion ) . then ( value => {
@@ -299,6 +303,7 @@ module.exports = (chai, utils) => {
299
303
} ) ;
300
304
301
305
module . exports . transferPromiseness ( assertion , derivedPromise ) ;
306
+ return assertion ;
302
307
}
303
308
304
309
// ### Now use the `Assertion` framework to build an `assert` interface.
0 commit comments