@@ -53,16 +53,10 @@ ruleTester.run('catch-or-return', rule, {
53
53
options : [ { allowThen : true } ] ,
54
54
} ,
55
55
56
- // allowThen - .then(null, fn)
57
- { code : 'frank().then(a, b)' , options : [ { allowThen : true } ] } ,
58
56
{
59
57
code : 'frank().then(a).then(b).then(null, c)' ,
60
58
options : [ { allowThen : true } ] ,
61
59
} ,
62
- {
63
- code : 'frank().then(a).then(b).then(c, d)' ,
64
- options : [ { allowThen : true } ] ,
65
- } ,
66
60
{
67
61
code : 'frank().then(a).then(b).then().then().then(null, doIt)' ,
68
62
options : [ { allowThen : true } ] ,
@@ -73,10 +67,15 @@ ruleTester.run('catch-or-return', rule, {
73
67
} ,
74
68
75
69
// allowThen - .then(fn, fn)
70
+ { code : 'frank().then(a, b)' , options : [ { allowThen : true } ] } ,
76
71
{
77
72
code : 'frank().then(go).then(zam, doIt)' ,
78
73
options : [ { allowThen : true } ] ,
79
74
} ,
75
+ {
76
+ code : 'frank().then(a).then(b).then(c, d)' ,
77
+ options : [ { allowThen : true } ] ,
78
+ } ,
80
79
{
81
80
code : 'frank().then(go).then().then().then().then(wham, doIt)' ,
82
81
options : [ { allowThen : true } ] ,
@@ -90,6 +89,37 @@ ruleTester.run('catch-or-return', rule, {
90
89
options : [ { allowThen : true } ] ,
91
90
} ,
92
91
92
+ // allowThenStrict - .then(null, fn)
93
+ {
94
+ code : 'frank().then(go).then(null, doIt)' ,
95
+ options : [ { allowThenStrict : true } ] ,
96
+ } ,
97
+ {
98
+ code : 'frank().then(go).then().then().then().then(null, doIt)' ,
99
+ options : [ { allowThenStrict : true } ] ,
100
+ } ,
101
+ {
102
+ code : 'frank().then(go).then().then(null, function() { /* why bother */ })' ,
103
+ options : [ { allowThenStrict : true } ] ,
104
+ } ,
105
+ {
106
+ code : 'frank.then(go).then(to).then(null, jail)' ,
107
+ options : [ { allowThenStrict : true } ] ,
108
+ } ,
109
+
110
+ {
111
+ code : 'frank().then(a).then(b).then(null, c)' ,
112
+ options : [ { allowThenStrict : true } ] ,
113
+ } ,
114
+ {
115
+ code : 'frank().then(a).then(b).then().then().then(null, doIt)' ,
116
+ options : [ { allowThenStrict : true } ] ,
117
+ } ,
118
+ {
119
+ code : 'frank().then(a).then(b).then(null, function() { /* why bother */ })' ,
120
+ options : [ { allowThenStrict : true } ] ,
121
+ } ,
122
+
93
123
// allowFinally - .finally(fn)
94
124
{
95
125
code : 'frank().then(go).catch(doIt).finally(fn)' ,
@@ -234,5 +264,76 @@ ruleTester.run('catch-or-return', rule, {
234
264
code : 'frank().catch(go).someOtherMethod()' ,
235
265
errors : [ { message : catchMessage } ] ,
236
266
} ,
267
+
268
+ // .then(null, fn)
269
+ {
270
+ code : 'frank().then(a).then(b).then(null, c)' ,
271
+ errors : [ { message : catchMessage } ] ,
272
+ } ,
273
+ {
274
+ code : 'frank().then(a).then(b).then().then().then(null, doIt)' ,
275
+ errors : [ { message : catchMessage } ] ,
276
+ } ,
277
+ {
278
+ code : 'frank().then(a).then(b).then(null, function() { /* why bother */ })' ,
279
+ errors : [ { message : catchMessage } ] ,
280
+ } ,
281
+
282
+ // .then(fn, fn)
283
+ {
284
+ code : 'frank().then(a, b)' ,
285
+ errors : [ { message : catchMessage } ] ,
286
+ } ,
287
+ {
288
+ code : 'frank().then(go).then(zam, doIt)' ,
289
+ errors : [ { message : catchMessage } ] ,
290
+ } ,
291
+ {
292
+ code : 'frank().then(a).then(b).then(c, d)' ,
293
+ errors : [ { message : catchMessage } ] ,
294
+ } ,
295
+ {
296
+ code : 'frank().then(go).then().then().then().then(wham, doIt)' ,
297
+ errors : [ { message : catchMessage } ] ,
298
+ } ,
299
+ {
300
+ code : 'frank().then(go).then().then(function() {}, function() { /* why bother */ })' ,
301
+ errors : [ { message : catchMessage } ] ,
302
+ } ,
303
+ {
304
+ code : 'frank.then(go).then(to).then(pewPew, jail)' ,
305
+ errors : [ { message : catchMessage } ] ,
306
+ } ,
307
+
308
+ {
309
+ code : 'frank().then(a, b)' ,
310
+ errors : [ { message : catchMessage } ] ,
311
+ options : [ { allowThenStrict : true } ] ,
312
+ } ,
313
+ {
314
+ code : 'frank().then(go).then(zam, doIt)' ,
315
+ errors : [ { message : catchMessage } ] ,
316
+ options : [ { allowThenStrict : true } ] ,
317
+ } ,
318
+ {
319
+ code : 'frank().then(a).then(b).then(c, d)' ,
320
+ errors : [ { message : catchMessage } ] ,
321
+ options : [ { allowThenStrict : true } ] ,
322
+ } ,
323
+ {
324
+ code : 'frank().then(go).then().then().then().then(wham, doIt)' ,
325
+ errors : [ { message : catchMessage } ] ,
326
+ options : [ { allowThenStrict : true } ] ,
327
+ } ,
328
+ {
329
+ code : 'frank().then(go).then().then(function() {}, function() { /* why bother */ })' ,
330
+ errors : [ { message : catchMessage } ] ,
331
+ options : [ { allowThenStrict : true } ] ,
332
+ } ,
333
+ {
334
+ code : 'frank.then(go).then(to).then(pewPew, jail)' ,
335
+ errors : [ { message : catchMessage } ] ,
336
+ options : [ { allowThenStrict : true } ] ,
337
+ } ,
237
338
] ,
238
339
} )
0 commit comments