@@ -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 } ] ,
@@ -234,5 +233,45 @@ ruleTester.run('catch-or-return', rule, {
234
233
code : 'frank().catch(go).someOtherMethod()' ,
235
234
errors : [ { message : catchMessage } ] ,
236
235
} ,
236
+
237
+ // .then(null, fn)
238
+ {
239
+ code : 'frank().then(a).then(b).then(null, c)' ,
240
+ errors : [ { message : catchMessage } ] ,
241
+ } ,
242
+ {
243
+ code : 'frank().then(a).then(b).then().then().then(null, doIt)' ,
244
+ errors : [ { message : catchMessage } ] ,
245
+ } ,
246
+ {
247
+ code : 'frank().then(a).then(b).then(null, function() { /* why bother */ })' ,
248
+ errors : [ { message : catchMessage } ] ,
249
+ } ,
250
+
251
+ // .then(fn, fn)
252
+ {
253
+ code : 'frank().then(a, b)' ,
254
+ errors : [ { message : catchMessage } ] ,
255
+ } ,
256
+ {
257
+ code : 'frank().then(go).then(zam, doIt)' ,
258
+ errors : [ { message : catchMessage } ] ,
259
+ } ,
260
+ {
261
+ code : 'frank().then(a).then(b).then(c, d)' ,
262
+ errors : [ { message : catchMessage } ] ,
263
+ } ,
264
+ {
265
+ code : 'frank().then(go).then().then().then().then(wham, doIt)' ,
266
+ errors : [ { message : catchMessage } ] ,
267
+ } ,
268
+ {
269
+ code : 'frank().then(go).then().then(function() {}, function() { /* why bother */ })' ,
270
+ errors : [ { message : catchMessage } ] ,
271
+ } ,
272
+ {
273
+ code : 'frank.then(go).then(to).then(pewPew, jail)' ,
274
+ errors : [ { message : catchMessage } ] ,
275
+ } ,
237
276
] ,
238
277
} )
0 commit comments