@@ -17,13 +17,17 @@ ruleTester.run('always-return', rule, {
17
17
'hey.then(x => { return; })' ,
18
18
'hey.then(x => { return x ? x.id : null })' ,
19
19
'hey.then(x => { return x * 10 })' ,
20
+ 'hey.then(x => { process.exit(0); })' ,
21
+ 'hey.then(x => { process.abort(); })' ,
20
22
'hey.then(function() { return 42; })' ,
21
23
'hey.then(function() { return new Promise(); })' ,
22
24
'hey.then(function() { return "x"; }).then(doSomethingWicked)' ,
23
25
'hey.then(x => x).then(function() { return "3" })' ,
24
26
'hey.then(function() { throw new Error("msg"); })' ,
25
27
'hey.then(function(x) { if (!x) { throw new Error("no x"); } return x; })' ,
26
28
'hey.then(function(x) { if (x) { return x; } throw new Error("no x"); })' ,
29
+ 'hey.then(function(x) { if (x) { process.exit(0); } throw new Error("no x"); })' ,
30
+ 'hey.then(function(x) { if (x) { process.abort(); } throw new Error("no x"); })' ,
27
31
'hey.then(x => { throw new Error("msg"); })' ,
28
32
'hey.then(x => { if (!x) { throw new Error("no x"); } return x; })' ,
29
33
'hey.then(x => { if (x) { return x; } throw new Error("no x"); })' ,
@@ -140,6 +144,10 @@ ruleTester.run('always-return', rule, {
140
144
code : 'hey.then(function() { if (x) { } else { return x; }})' ,
141
145
errors : [ { message } ] ,
142
146
} ,
147
+ {
148
+ code : 'hey.then(function() { if (x) { process.chdir(); } else { return x; }})' ,
149
+ errors : [ { message } ] ,
150
+ } ,
143
151
{
144
152
code : 'hey.then(function() { if (x) { return you.then(function() { return x; }); } })' ,
145
153
errors : [ { message } ] ,
0 commit comments