mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added test cases for the @returns tag.
This commit is contained in:
parent
8f73a4f2f1
commit
dd990a434c
11
test/cases/returnstag.js
Normal file
11
test/cases/returnstag.js
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @returns { String | Array<String>} The names of the found item(s).
|
||||
*/
|
||||
function find(targetName) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The binding id.
|
||||
*/
|
||||
function bind(callback) {
|
||||
}
|
||||
20
test/t/cases/returnstag.js
Normal file
20
test/t/cases/returnstag.js
Normal file
@ -0,0 +1,20 @@
|
||||
(function() {
|
||||
var docSet = testhelpers.getDocSetFromFile('test/cases/returnstag.js'),
|
||||
find = docSet.getByLongname('find')[0],
|
||||
bind = docSet.getByLongname('bind')[0];
|
||||
|
||||
//dump(docSet.doclets); exit(0);
|
||||
|
||||
test('When a symbol has an @returns tag with a type and description, the doclet has a returns property that includes that return.', function() {
|
||||
assert.equal(typeof find.returns, 'object');
|
||||
assert.equal(find.returns.type.names.join(', '), 'String, Array<String>');
|
||||
assert.equal(find.returns.description, 'The names of the found item(s).');
|
||||
});
|
||||
|
||||
test('When a symbol has an @param tag with only a type and name, the doclet has a params property that includes that param.', function() {
|
||||
assert.equal(typeof bind.returns, 'object');
|
||||
assert.equal(bind.returns.description, 'The binding id.');
|
||||
});
|
||||
|
||||
|
||||
})();
|
||||
Loading…
x
Reference in New Issue
Block a user