@@ -33,6 +33,16 @@ ruleTester.run('valid-params', rule, {
33
33
'Promise.all(iterable)' ,
34
34
'Promise.all([one, two, three])' ,
35
35
36
+ // valid Promise.allSettled()
37
+ 'Promise.allSettled([])' ,
38
+ 'Promise.allSettled(iterable)' ,
39
+ 'Promise.allSettled([one, two, three])' ,
40
+
41
+ // valid Promise.any()
42
+ 'Promise.any([])' ,
43
+ 'Promise.any(iterable)' ,
44
+ 'Promise.any([one, two, three])' ,
45
+
36
46
// valid Promise.then()
37
47
'somePromise().then(success)' ,
38
48
'somePromise().then(success, failure)' ,
@@ -129,6 +139,32 @@ ruleTester.run('valid-params', rule, {
129
139
{ message : 'Promise.all() requires 1 argument, but received 4' } ,
130
140
] ,
131
141
} ,
142
+ // invalid Promise.allSettled()
143
+ {
144
+ code : 'Promise.allSettled(1, 2, 3)' ,
145
+ errors : [
146
+ { message : 'Promise.allSettled() requires 1 argument, but received 3' } ,
147
+ ] ,
148
+ } ,
149
+ {
150
+ code : 'Promise.allSettled({}, function() {}, 1, 2)' ,
151
+ errors : [
152
+ { message : 'Promise.allSettled() requires 1 argument, but received 4' } ,
153
+ ] ,
154
+ } ,
155
+ // invalid Promise.any()
156
+ {
157
+ code : 'Promise.any(1, 2, 3)' ,
158
+ errors : [
159
+ { message : 'Promise.any() requires 1 argument, but received 3' } ,
160
+ ] ,
161
+ } ,
162
+ {
163
+ code : 'Promise.any({}, function() {}, 1, 2)' ,
164
+ errors : [
165
+ { message : 'Promise.any() requires 1 argument, but received 4' } ,
166
+ ] ,
167
+ } ,
132
168
133
169
// invalid Promise.then()
134
170
{
0 commit comments