Skip to content

Commit bbf05ff

Browse files
author
Alexej Yaroshevich
committed
add test for #16
1 parent 5042da4 commit bbf05ff

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

test/test.validate-jsdoc-returns.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,37 @@ describe('rules/validate-jsdoc @returns', function() {
348348
);
349349
});
350350

351+
it('should not report on `@returns {foo.Bar}`. issue #16', function() {
352+
checker.configure({ jsDoc: { requireReturnTypes: true, checkReturnTypes: true } });
353+
assert(
354+
checker.checkString(
355+
'module.exports = {\n' +
356+
' /**\n' +
357+
' * @return {foo.Bar}\n' +
358+
' */\n' +
359+
' foo: function () {\n' +
360+
' return new foo.Bar();\n' +
361+
' },\n' +
362+
' /**\n' +
363+
' * @return {foo.Bar.Baz}\n' +
364+
' */\n' +
365+
' bar: function () {\n' +
366+
' return new foo.Bar.Baz();\n' +
367+
' },\n' +
368+
' /**\n' +
369+
' * @return {foo.Bar.Baz|foo.Bar.Baz.Moo}\n' +
370+
' */\n' +
371+
' baz: function (t) {\n' +
372+
' if (t) {\n' +
373+
' return new foo.Bar.Baz.Moo();\n' +
374+
' }\n' +
375+
' return new foo.Bar.Baz();\n' +
376+
' }\n' +
377+
'};\n'
378+
).isEmpty()
379+
);
380+
});
381+
351382
});
352383

353384
});

0 commit comments

Comments
 (0)