@@ -17,13 +17,17 @@ ruleTester.run('always-return', rule, {
1717 'hey.then(x => { return; })' ,
1818 'hey.then(x => { return x ? x.id : null })' ,
1919 'hey.then(x => { return x * 10 })' ,
20+ 'hey.then(x => { process.exit(0); })' ,
21+ 'hey.then(x => { process.abort(); })' ,
2022 'hey.then(function() { return 42; })' ,
2123 'hey.then(function() { return new Promise(); })' ,
2224 'hey.then(function() { return "x"; }).then(doSomethingWicked)' ,
2325 'hey.then(x => x).then(function() { return "3" })' ,
2426 'hey.then(function() { throw new Error("msg"); })' ,
2527 'hey.then(function(x) { if (!x) { throw new Error("no x"); } return x; })' ,
2628 '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"); })' ,
2731 'hey.then(x => { throw new Error("msg"); })' ,
2832 'hey.then(x => { if (!x) { throw new Error("no x"); } return x; })' ,
2933 'hey.then(x => { if (x) { return x; } throw new Error("no x"); })' ,
@@ -140,6 +144,10 @@ ruleTester.run('always-return', rule, {
140144 code : 'hey.then(function() { if (x) { } else { return x; }})' ,
141145 errors : [ { message } ] ,
142146 } ,
147+ {
148+ code : 'hey.then(function() { if (x) { process.chdir(); } else { return x; }})' ,
149+ errors : [ { message } ] ,
150+ } ,
143151 {
144152 code : 'hey.then(function() { if (x) { return you.then(function() { return x; }); } })' ,
145153 errors : [ { message } ] ,
0 commit comments