Skip to content

Commit 5c963e0

Browse files
author
Alexej Yaroshevich
committed
checkRedundantReturns: add test for issue #34
1 parent e794e86 commit 5c963e0

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

test/lib/rules/validate-jsdoc/check-redundant-returns.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ describe('rules/validate-jsdoc', function () {
33
additionalRules: ['lib/rules/validate-jsdoc.js']
44
});
55

6-
describe('check-redudant-returns', function() {
6+
describe('check-redundant-returns', function() {
77

88
checker.rules({checkRedundantReturns: true});
99
checker.cases([
@@ -44,6 +44,19 @@ describe('rules/validate-jsdoc', function () {
4444
if (true) { return x; }
4545
}
4646
}
47+
}, {
48+
it: 'should not report expression return for inner call result',
49+
code: function () {
50+
/**
51+
* @function
52+
* @return {Promise} a promise
53+
*/
54+
function onEvent () {
55+
return this.login().then(function () {
56+
// do some else
57+
});
58+
}
59+
}
4760
}
4861
/* jshint ignore:end */
4962
]);

0 commit comments

Comments
 (0)